RE: [Dev-C++] Trouble compiling winsock programs.
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Manoj S. <sha...@ro...> - 2002-12-30 00:13:44
|
Hi, Thanks for your prompt responses! I should have mentioned in my earlier that I did try adding the -lwsock32 option to the linker command line.I tried it once again though and the result was the same as before.The undefined reference error to WSAStartup error still shows up. Also I would like to run this a stand alone file (not a project). Any suggestions? Thanks in advance once again for your help. Regards, Manoj. http://manoj_sharma0.tripod.com -----Original Message----- From: Abhijit Shylanath [mailto:mu...@gm...] Sent: Sunday, December 29, 2002 2:57 PM To: Manoj Sharma; Dev-C++ Subject: Re: [Dev-C++] Trouble compiling winsock programs. Greets, Manoj. > I am trying to compile a simple winsock program using Dev-C++ and get the > following error > [Linker error] undefined reference to WSAStartup@8. I tried generating my > own libwsock32.a library using the wsock32.dll on my system with the help > of the dllwrap utility and linking it to my program by copying the generated > .a file to the lib directory but the error stayed the same. Just because a file is present in the `lib' directory, doesn't mean that it'll be linked in. You need to add it to your the list of libraries the linker must add. Add `-lwsock32' to the linker command-line. Any lib by the name `libfoo.a' in the `lib' directory has to/can be linked in using -lfoo. HTH. ___________________________________________________________ Abhijit Shylanath E-mail: mu...@gm... || ibr...@bi... Web-site: http://mudeth.tripod.com/ |