I'm trying to compile a sourceforge.net project called MiniWeb HTTP server (it seems abandoned for almost a year). After several corrections, I've found a last problem I can't resolve.
1) I downloaded as tar from SVN.
2) I applied several corrections (3297135 and 3297167).
3) I link with:
Code:
gcc -lws2_32 httppil.o http.o httpxml.o httphandler.o httppost.o httpauth.o miniweb.o -o miniweb
And I get:
Code:
httppil.o:httppil.c:(.text+0x1b): undefined reference to `WSAStartup@8'
httppil.o:httppil.c:(.text+0x38): undefined reference to `WSAStartup@8'
httppil.o:httppil.c:(.text+0x68): undefined reference to `WSACleanup@0'
http.o:http.c:(.text+0x3a5): undefined reference to `closesocket@4'
http.o:http.c:(.text+0x5bf): undefined reference to `socket@12'
http.o:http.c:(.text+0x612): undefined reference to `htons@4'
http.o:http.c:(.text+0x633): undefined reference to `bind@12'
http.o:http.c:(.text+0x65e): undefined reference to `listen@8'
http.o:http.c:(.text+0x83a): undefined reference to `getsockopt@20'
http.o:http.c:(.text+0xa12): undefined reference to `select@20'
http.o:http.c:(.text+0xa85): undefined reference to `__WSAFDIsSet@8'
http.o:http.c:(.text+0xaa3): undefined reference to `__WSAFDIsSet@8'
http.o:http.c:(.text+0xbac): undefined reference to `__WSAFDIsSet@8'
http.o:http.c:(.text+0xc85): undefined reference to `ntohl@4'
http.o:http.c:(.text+0xea7): undefined reference to `accept@12'
http.o:http.c:(.text+0xf20): undefined reference to `setsockopt@20'
http.o:http.c:(.text+0x1a73): undefined reference to `recv@16'
http.o:http.c:(.text+0x246c): undefined reference to `closesocket@4'
http.o:http.c:(.text+0x2a5b): undefined reference to `send@16'
http.o:http.c:(.text+0x2a84): undefined reference to `send@16'
http.o:http.c:(.text+0x2f56): undefined reference to `send@16'
http.o:http.c:(.text+0x2f86): undefined reference to `send@16'
http.o:http.c:(.text+0x3122): undefined reference to `send@16'
http.o:http.c:(.text+0x3253): more undefined references to `send@16' follow
httphandler.o:httphandler.c:(.text+0x687): undefined reference to `select@20'
httphandler.o:httphandler.c:(.text+0x6cb): undefined reference to `send@16'
httppost.o:httppost.c:(.text+0x1a6): undefined reference to `getpeername@12'
httppost.o:httppost.c:(.text+0x1bd): undefined reference to `ntohl@4'
httppost.o:httppost.c:(.text+0x1ce): undefined reference to `inet_ntoa@4'
httppost.o:httppost.c:(.text+0x223): undefined reference to `getpeername@12'
httppost.o:httppost.c:(.text+0x231): undefined reference to `inet_ntoa@4'
httppost.o:httppost.c:(.text+0x2ea): undefined reference to `recv@16'
httpauth.o:httpauth.c:(.text+0x20): undefined reference to `g_httpParam'
httpauth.o:httpauth.c:(.text+0x2b): undefined reference to `g_httpParam'
httpauth.o:httpauth.c:(.text+0x4a): undefined reference to `g_httpParam'
collect2: ld returned 1 exit status
The name of the library is ws2_32 according to the makefile and to MSDN. I also tried wsock32 and get the same errors. And if I prefixed lib it tells me it can not find it.
So, I don't know where is the problem.
PS: If helps:
OS: Windows XP Professional 2002 SP 3 (Spanish)
PC: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ 2.01 GHz, 960 MB RAM
gcc -v:
Code:
Reading specs from C:/Programas/dev-cpp/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw-vista special r3)