undefined reference to `__imp_WSACleanup'
to your command-line instead of
#pragma when compiling with MinGW
g++ src/main.cpp -o release/myApp.exe -lwsock32
I met the same problem with you. I solved it by adding a command
you can add the command according follow steps:
- compiler options
add the following commands when calling the compilers
then you can add the above command
In DevC++, navigate to Project >> Project Options (or via usually ctrl+h); then in the "Parameters" tab there is a button "Add Library or Object" and then add
The pragma you use only works for the Visual C++ Compiler and will be ignored by the gcc
#pragma comment(lib, "ws2_32")
you have to add the ws2_32.lib it manually in the makefile. like:
(I guess it was without the ".lib" at the end)
at the end of the g++ line. You have of course add the full path which I have not by hand at the moment.