Apart from the causes already discussed, “undefined reference” may also occur because of the following reasons. #4) Wrong Project Type. When we specify wrong project types in C IDEs like the visual studio and try to do things that the project does not expect, then, we get “undefined reference”. The function I tried to use was ceil and I get the following error:: undefined reference to `ceil' collect2: ld returned 1 exit status I am using the latest Ubuntu and math.h is there. I tried to use -lm in a different computer and it work perfectly. Does anyone know how to solve this problem?
Undefined Reference To Ceil'
Similar topics
: undefined reference to `ceil' collect2: ld returned 1 exit status I've also tried #cc -lm myprogram.c and then tried compiling it, but this didn't help and displayed the same message. An alternative situation arises where the source for foo is in a separate source file foo.c (and there's a header foo.h to declare foo that is included in both foo.c and undefinedreference.c). Then the fix is to link both the object file from foo.c and undefinedreference.c, or to compile both the source files.
Undefined Reference To Symbol Ceil
8 posts views Thread by Schklerg | last post: by |
6 posts views Thread by Penguin | last post: by |
10 posts views Thread by tmeister | last post: by |
9 posts views Thread by Ronald W. Roberts | last post: by |
4 posts views Thread by Chris Davoli | last post: by |
36 posts views Thread by Phat G5 (G3) | last post: by |
4 posts views Thread by Fuzzydave | last post: by |
6 posts views Thread by dkirkdrei | last post: by |
4 posts views Thread by =?Utf-8?B?UmVuZQ?= | last post: by |
reply views Thread by Edwin.Madari | last post: by |
reply views Thread by ravipankaj | last post: by |
reply views Thread by ravipankaj | last post: by |
reply views Thread by NPC403 | last post: by |
reply views Thread by slotstar | last post: by |
7 posts views Thread by isladogs | last post: by |
1 post views Thread by selyn9507 | last post: by |
1 post views Thread by ahmedmob | last post: by |
4 posts views Thread by jackjee | last post: by |
5 posts views Thread by Bhagaban | last post: by |