mingw + codeblocks + curl without dll (standalone)

  • add “CURL_STATICLIB” at Project->Build options->#define
  • add “libcurl.a”, “libcurldll.a” and “libwlap32.a” at Project->Build options->Linker settings
, , , ,

Code::Blocks #pragma comment(lib, “ws2_32.lib”)

if there is “#pragma comment(lib, “ws2_32.lib”)” included or you see some errors like:

[Linker error] undefined reference to `WSAStartup@8′

[Linker error] undefined reference to `socket@12′

[Linker error] undefined reference to `WSACleanup@0′

[Linker error] undefined reference to `htons@4′

[Linker error] undefined reference to `bind@12′

[Linker error] undefined reference to `listen@8′

[Linker error] undefined reference to `WSAAsyncSelect@16′

ld returned 1 exit status

Please add “-lwsock32.dll” at Project>Linker settings>Other linker optios.

, , ,

Dependency on mingwm10.dll using Code::Blocks

eliminate the mingwm10.dll dependencies of  GUI
application to be able to ship a single executable file.

remove “-mthreads” at “other linker options”.

, ,