News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

What could be wrong with this library linking setting?

Started by 198710, May 27, 2010, 09:16:52 AM

Previous topic - Next topic

198710

I tried to move my socket project from linux to windows,everything OK in linux,but it seems "-lwsock32" option never works on windows :(
How does C::B handle the order of the libraries?


[attachment deleted by admin]

Phenom

Maybe you should add the library to the "Link libraries" section.
Just click add and type "wsock32".

Also turn on full command line logging and post the build log here.

198710

Thanks!
I tried the command line way and find out that my library should be placed before wsock32,but I'm still wondering if there should be the chance to set the order of libraries manually inside C::B :?

MortenMacFly

Quote from: 198710 on May 27, 2010, 10:08:19 AM
but I'm still wondering if there should be the chance to set the order of libraries manually inside C::B :?
Of course there is! Just re-order the libraries as needed in the build options of your project, tab "linker settings" -> "link libraries". That's what the up-and-down-buttons just right of this box are for. :-)
Oh - and don't forget to add wsock32 as library!!! Not an additional linker command. This will not work otherwise.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]