gcc linking stdlib?
Asked by
vergarr
I am trying to compile a program that I am working on and I keep getting the error:
called object ‘rand’ is not a function.
The error specifies this line:
x += drifter.oxy = 10+ GetNum(10);
with GetNum defined as:
#define GetNum(d) ( rand() %d +1 )
After looking through the lib and usr/lib directories AND using
grep -l rand * | more
I couldn't figure out which file to link to gcc I tried the ones that looked most promising, and even tried -l* but no luck. So I tried compiling another program I have that also calls for rand() and it compiles with no problems.
Both #include <the same files> accept that the one that wont compile also includes strings.h. I tried commenting that include out with the same effect.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- W. Prins
- Solved:
- Last query:
- Last reply:
To post a message you must log in.