Easy linker problem

Walliss, Darren wallissd@anz.com
Tue Nov 28 02:17:00 GMT 2006


I want to use function 'sleep' in a program.

When I compile my test prog with < gcc sleepTest.c -o sleepTest
-mno-cygwin >

I get:
$ gcc sleepTest.c -o sleepTest -mno-cygwin
/cygdrive/c/DOCUME~1/wallissd/LOCALS~1/Temp/ccW7l2vq.o:sleepTest.c:(.tex
t+0x5e):
 undefined reference to `_sleep'
collect2: ld returned 1 exit status

Do I need a -lxxxxxx.a in the compile statement for the linker?
If so:
- how do I know which lib to use an a given situation, is there a
reference out there somewhere??
- have I buggered up my lib paths, shouldn't this stuff be found
automatically?

Darren



"This e-mail and any attachments to it (the "Communication") is, unless otherwise stated, confidential,  may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Australia and New Zealand Banking Group Limited ABN 11 005 357 522, or any of its related entities including ANZ National Bank Limited (together "ANZ"). ANZ does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication."



More information about the Gcc-help mailing list