This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: linking problems using gcc
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Niklas Odenteg <niod at home dot se>
- Cc: cygwin at cygwin dot com
- Date: Thu, 25 Nov 2004 11:25:02 -0500 (EST)
- Subject: Re: linking problems using gcc
- References: <001901c4d30a$613455d0$8000000a@katarinaII>
- Reply-to: cygwin at cygwin dot com
On Thu, 25 Nov 2004, Niklas Odenteg wrote:
> Hi!
>
> This may be a newbee Q, but I'll try anyway ;-)
>
> I trying to link a small C/C++ program and I got linking error on time(),
> rand() and srand(). These should be part of libc right? So way are they
> missing? Has cygwin some special libc implementation or something???
>
> Confused programmer needs some help.
Please post a small simple program that demonstrates the error, the exact
command line you used to compile it, and the exact error you get from gcc.
At a guess, you are missing some #includes, so the functions aren't
declared as 'extern "C"', and are name-mangled, so the linker doesn't find
them.
> Tanks!
:-O Where?
> /Niklas
HTH,
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/