G
Grey Knight
Here's a problem which is driving me slowly insane. Using GCC version
3.3.1 on SuSE 9.0, I keep getting "undefined reference to
`function'"-type errors for no apparent reason! It's driving me
bonkers. Here's a tiny sample program which reproduces the problem.
I've also included an extract of the shell session I used to launch it
(so you can tell me if I'm missing any crucial commandline
parameters), and an excerpt from the -aux-info dump which seems to say
that the function in question WAS in fact defined.
It's enough to make me gibber!
/**SOF:"test.c"**/
#include <stdio.h>
#include <math.h>
int main(int argc, char* argv[]) {
double x;
for(x=0; x<=32; x++) {
printf("%2.0f : %6.3f\n",x,sin(x*3.141592653/16));
}
}
/**EOF**/
/**SOT:"shell extract"**/
greyknight@gaius:> gcc -aux-info test.dump -o test test.c
/tmp/ccO1su8V.o(.text+0x55): In function `main':
: undefined reference to `sin'
collect2: ld returned 1 exit status
bash: ./test: No such file or directory
/**EOT**/
/**SOT:"test.dump extract"**/
/* /usr/include/bits/mathcalls.h:66:NC */ extern double sin (double);
/**EOT**/
3.3.1 on SuSE 9.0, I keep getting "undefined reference to
`function'"-type errors for no apparent reason! It's driving me
bonkers. Here's a tiny sample program which reproduces the problem.
I've also included an extract of the shell session I used to launch it
(so you can tell me if I'm missing any crucial commandline
parameters), and an excerpt from the -aux-info dump which seems to say
that the function in question WAS in fact defined.
It's enough to make me gibber!
/**SOF:"test.c"**/
#include <stdio.h>
#include <math.h>
int main(int argc, char* argv[]) {
double x;
for(x=0; x<=32; x++) {
printf("%2.0f : %6.3f\n",x,sin(x*3.141592653/16));
}
}
/**EOF**/
/**SOT:"shell extract"**/
greyknight@gaius:> gcc -aux-info test.dump -o test test.c
/tmp/ccO1su8V.o(.text+0x55): In function `main':
: undefined reference to `sin'
collect2: ld returned 1 exit status
bash: ./test: No such file or directory
/**EOT**/
/**SOT:"test.dump extract"**/
/* /usr/include/bits/mathcalls.h:66:NC */ extern double sin (double);
/**EOT**/