Hello,
with the compiler-options 'gpc --automake -o .....' I get the following error on Solaris2.6 :
Undefined first referenced symbol in file sinl maths.o cosl Stroem.o ld: fatal: Symbol referencing errors. No output written...
although there is no 'sinl' or 'cosl' in the source code. Are there some special Linking-options (e.g. in C the -l option for mathmatical libraries) that I missed??
Hope, somebody can help me
Thanks very much Matthias
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
- Matthias Friedrich - email: mafri@ipg.uni-freiburg.de
Matthias Friedrich a écrit:
Hello,
with the compiler-options 'gpc --automake -o .....' I get the following error on Solaris2.6 :
Undefined first referenced symbol in file sinl maths.o cosl Stroem.o ld: fatal: Symbol referencing errors. No output written...
although there is no 'sinl' or 'cosl' in the source code.
I had the same problem on djgpp with the beta gpc-19990118
Franck gave me the following solution:
-------------------------------------------------------------- Yes, that's a new bug. Since it only shows on systems without cosl() etc. in their libm, like DJGPP, we didn't note it so far.
Here's the fix, if you have the GPC sources and can recompile them:
diff -p -r -U3 -N -X /home/frank/script/gpcdiff.exclude orig/p/rts.c p/rts.c --- orig/p/rts.c Wed Feb 17 21:56:06 1999 +++ p/rts.c Wed Feb 24 02:01:13 1999 @@ -78,16 +78,16 @@ struct rts_symbol rts[] = {
{ r_COLLECT,"_p_collect", NULL_RTX, NULL_TREE, 0},
- { p_ARCTAN, "atan", NULL_RTX, NULL_TREE, 0}, - { p_COS, "cos", NULL_RTX, NULL_TREE, 0}, + { p_ARCTAN, "_p_arctan", NULL_RTX, NULL_TREE, 0}, + { p_COS, "_p_cos", NULL_RTX, NULL_TREE, 0}, { p_EXP, "_p_exp", NULL_RTX, NULL_TREE, 0}, { p_LN, "_p_ln", NULL_RTX, NULL_TREE, 0}, - { p_SIN, "sin", NULL_RTX, NULL_TREE, 0}, + { p_SIN, "_p_sin", NULL_RTX, NULL_TREE, 0}, { p_SQRT, "_p_sqrt", NULL_RTX, NULL_TREE, 0},
- { pp_ARCTAN, "atanl", NULL_RTX, NULL_TREE, 0}, - { pp_SIN, "sinl", NULL_RTX, NULL_TREE, 0}, - { pp_COS, "cosl", NULL_RTX, NULL_TREE, 0}, + { pp_ARCTAN, "_pp_arctan", NULL_RTX, NULL_TREE, 0}, + { pp_SIN, "_pp_sin", NULL_RTX, NULL_TREE, 0}, + { pp_COS, "_pp_cos", NULL_RTX, NULL_TREE, 0}, { pp_EXP, "_pp_exp", NULL_RTX, NULL_TREE, 0}, { pp_LN, "_pp_ln", NULL_RTX, NULL_TREE, 0}, { pp_SQRT, "_pp_sqrt", NULL_RTX, NULL_TREE, 0},
Otherwise, you can work around the bug until the next release by linking the following C file:
#include <math.h> long double sinl (long double x) { return sin (x); } long double cosl (long double x) { return cos (x); } long double sqrtl (long double x) { return sqrt (x); } long double logl (long double x) { return log (x); } long double expl (long double x) { return exp (x); } long double atanl (long double x) { return atan (x); } long double powl (long double x, long double y) { return pow (x, y); } ------------------------------------------------------------------
I used the second solution which worked satisfactorily. This bug has indeed disappeared in more recent alphas, but others popped up.
Hope this help