I have the following code snippet:
#include <stdio.h>
#include <math.h>
int main(void)
{
double i;
i = sqrt(9);
printf("%e\n",i);
return 0;
}
With g++, it compiles fine.
With gcc, I get:
"... undefined reference to 'sqrt'"
"collect2: ld returned 1 exit status code"
Now, at first I thought my home system was somehow misconfigured, since
it appears to be a linker problem. I tried the same code on another
machine, which should be properly configured, and got the same error.
So... what am I missing? Is it gcc, ld, or the code is simply wrong?
Thanks in advance!
--
mulix.
email: [EMAIL PROTECTED]
linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]