#9 winsock linking issue

closed
nobody
5
2009-04-24
2009-04-22
No

Hi

Now I'm getting linker errors about socket functions:

socket.c:42: undefined reference to `__imp__socket'
socket.c:60: undefined reference to `__imp__bind'
socket.c:62: undefined reference to `__imp__closesocket'
socket.c:65: undefined reference to `__imp__listen'

Toolchain: mingw-w64-bin_i686-cygwin-1.5.25-15_20090419.tar-bz2 (automated build)

Relevent output:

Build line[@x86_64-pc-mingw32-gcc -v -o ../dist/argusd -Xlinker --stack -Xlinker 4096 -Xlinker --heap -Xlinker 4096 ..//obj/*.o -lm -lpsapi -LWINDOWS -lpthreadGC2 ]
Using built-in specs.
Target: x86_64-pc-mingw32
Configured with: ../gcc/configure --target=x86_64-pc-mingw32 --prefix=/var/lib/buildbot/slave-vista64-cyg32/cygwin-x86/build/root --with-sysroot=/var/lib/buildbot/slave-vista64-cyg32/cygwin-x86/build/root --enable-languages=all,obj-c++ --disable-multilib
Thread model: win32
gcc version 4.5.0 20090419 (experimental) (GCC)
COMPILER_PATH=/mingw64/bin/../libexec/gcc/x86_64-pc-mingw32/4.5.0/:/mingw64/bin/../libexec/gcc/:/mingw64/bin/../lib/gcc/x86_64-pc-mingw32/4.5.0/../../../../x86_64-pc-mingw32/bin/
LIBRARY_PATH=/mingw64/bin/../lib/gcc/x86_64-pc-mingw32/4.5.0/:/mingw64/bin/../lib/gcc/:/mingw64/bin/../lib/gcc/x86_64-pc-mingw32/4.5.0/../../../../x86_64-pc-mingw32/lib/
COLLECT_GCC_OPTIONS='-v' '-o' '../dist/app' '-LWINDOWS' '-mtune=generic'
/mingw64/bin/../libexec/gcc/x86_64-pc-mingw32/4.5.0/collect2.exe --sysroot=/var/lib/buildbot/slave-vista64-cyg32/cygwin-x86/build/root -Bdynamic -o ../dist/app /mingw64/bin/../lib/gcc/x86_64-pc-mingw32/4.5.0/../../../../x86_64-pc-mingw32/lib/crt2.o /mingw64/bin/../lib/gcc/x86_64-pc-mingw32/4.5.0/../../../../x86_64-pc-mingw32/lib/crtbegin.o -LWINDOWS -L/mingw64/bin/../lib/gcc/x86_64-pc-mingw32/4.5.0 -L/mingw64/bin/../lib/gcc -L/mingw64/bin/../lib/gcc/x86_64-pc-mingw32/4.5.0/../../../../x86_64-pc-mingw32/lib --stack 4096 --heap 4096 ... ..//obj/socket.o ... -lm -lpsapi -lpthreadGC2 -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt /mingw64/bin/../lib/gcc/x86_64-pc-mingw32/4.5.0/../../../../x86_64-pc-mingw32/lib/crtend.o

What am I doing wrong?

Thanks

Discussion

  • Jack Kidwell

    Jack Kidwell - 2009-04-23

    It appears i neglected to use -lws2_32. The undefined references for socket functions are gone.

    However the undefined references for pthread are back. :(

     
  • Jack Kidwell

    Jack Kidwell - 2009-04-24
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks