Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: igi on June 19, 2007, 02:18:31 pm
-
i write simple server script using winsock.h, compile it use gcc
gcc -o win win.cpp
output like:
undefined reference to socket....blablabla
undefined reference to bind,........
i hope anyone can post solution
thx..
-
You didn't specify any library that should be linked with your app.
-
i tried compile with
gcc -o win win.cpp -lwinsock
is it right ??
-
i tried compile with
gcc -o win win.cpp -lwinsock
is it right ??
Well, if it worked, then it would've been right.
Since you're using MinGW's w32api package instead of Microsoft's, though, you'll need to use "-lwsock32" instead. See the .a files in the "lib" subdirectory of your MinGW installation (remember -l stands for "lib").