Trying.c:(.text+0xb5): undefined reference to `atan2'Ĭollect2: error: ld returned 1 exit status Trying.c:(.text+0x7a): undefined reference to `acos' ![]() Trying.c:(.text+0x5b): undefined reference to `sqrt' When I try to run the same code on an older Ubuntu distribution, it fails as you describe: gcc -lm trying.c Gcc trying.c -lm # compiles without error It compiles just fine with the -lm flag before or after the filename with a recent gcc: gcc -lm trying.c # compiles without error I tangled your code to create a source file named trying.c. ![]() I think this problem is caused by an old version of gcc.
0 Comments
Leave a Reply. |