I’m using minGW on windows, trying to compile a c++ program. I’ve used sockets in there, so I’m trying to link (not include… I’ve already included winsock.h) the wsock32 library. I know that the -L switch is for linking but none of the following commands work:
g++ C:\program.cpp -Lwsock32.lib
g++ C:\program.cpp -LC:\windows\system32\wsock32.dll
g++ C:\program.cpp -lC:\windows\system32\wsock32.dll
g++ C:\program.cpp -LC:\windows\system32\wsock32.lib
what should I do??
The
-Loption is for setting the directory where the linker should look for libraries/dlls.The
-loption is for naming the libraries/dlls you want to link with.That would mean
should be the command to compile your program from your regular windows command prompt.
I suspect your compiler may look in system32 automatically, so you may want to just try to skip the
-Loption.