Hi,
I already searched the internet for this problem, nothin found... :?
I started a simple ConsoleApplication with this text in main.cpp:
#include <winsock.h>
#include <iostream>
using namespace std;
int main()
{
WSADATA wsaData;
if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0)
{
cout<<"WSAStartup failed."<<endl;
}
return 0;
}
the compiler say:
Project : Console application
Compiler : GNU GCC Compiler (called directly)
Directory : G:\Dokumente und Einstellungen\ma\Eigene Dateien\Neuer Ordner (6)\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
Linking console executable: G:\Dokumente und Einstellungen\ma\Eigene Dateien\Neuer Ordner (6)\console.exe
.objs\main.o:main.cpp:(.text+0x145): undefined reference to `WSAStartup@8'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
I just want a simple Winsock App. I read on some sites its a problem with the lib files, but no one could tell how to fix it.
Using Code::Blocks 1RC2 Windows Version; GNU GCC compiler
QuoteI already searched the internet for this problem, nothin found...
Yeah right...clicky (http://www.google.com.gr/search?q=undefined+reference+to+%60WSAStartup%408'&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official)
Google says: Results 1 - 50 of about 565 English pages for undefined reference to `WSAStartup@8'. (2.46 seconds)
Add libws2_32.a in link libraries...
Thanks... :oops:
Looks like i have made some mistake, thanks again.
It works fine now with the lib :oops: