[pjsip] Win32 build doesn't build because of stddef.h

Roland Klabunde roland.klabunde at freenet.de
Sat Nov 10 09:50:58 EST 2007


M:/pj-sip/pjlib/src/pj/os_core_win32.c:134: undefined reference to
`WSAStartup at 8'
M:/pj-sip/pjlib/src/pj/os_core_win32.c:135: undefined reference to
`WSAGetLastError at 0'
M:/pj-sip/pjlib/src/pj/os_core_win32.c:135: undefined reference to
`WSAGetLastError at 0'
M:/pj-sip/pjlib/src/pj/os_core_win32.c:135: undefined reference to
`WSAGetLastError at 0'


You need to link the winsocket library.

----- Original Message ----- 
From: "Eagle I Martin Baranski" <eagle3386 at googlemail.com>
To: "pjsip embedded/DSP SIP discussion" <pjsip at lists.pjsip.org>
Sent: Saturday, November 10, 2007 3:05 PM
Subject: Re: [pjsip] Win32 build doesn't build because of stddef.h


> 2007/11/10, perry at pjsip.org <perry at pjsip.org>:
>> Excellent!
>>
>> Now we know the name of pjlib file on disk. That name will need to be
>> referenced on applications that use pjlib.
>>
>> Next, try to build pjlib-test. If it complains of unreferenced stuff
>> put the pjlib already build as -l.
>
> Thanks! :)
>
> Yes, it complains about unreferenced stuff.. Therefore, I've added
> "-lM:\pj-sip\pjlib\lib\libpjlib-i386-win32-vc8-debug.a" to the
> linker's options, but that didn't solve the problem (even just adding
> "-llibpjlib-i386-win32-vc8-debug.a" didn't help.. Full error:
>
> [100.0%] mingw32-gcc.exe -LC:\MinGW\lib
> -LC:\MinGW\lib\gcc\mingw32\3.4.5  -o
> ..\bin\pjlib-test-i386-win32-vc8-debug.exe
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\atomic.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\echo_clt.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\errno.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\exception.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\fifobuf.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\file.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\ioq_perf.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\ioq_tcp.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\ioq_udp.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\ioq_unreg.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\list.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\main.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\mutex.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\os.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\pool.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\pool_perf.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\rand.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\rbtree.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\select.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\sleep.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\sock.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\sock_perf.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\string.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\test.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\thread.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\timer.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\timestamp.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\udp_echo_srv_ioqueue.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\udp_echo_srv_sync.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\util.o
> -lM:\pj-sip\pjlib\lib\libpjlib-i386-win32-vc8-debug.a -s  -lnetapi32
> -lmswsock -lws2_32 -lodbc32 -lodbccp32 -loleaut32 -lole32
> C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:
> cannot find -lM:\pj-sip\pjlib\lib\libpjlib-i386-win32-vc8-debug.a
> collect2: ld returned 1 exit status
> Process terminated with status 1 (0 minutes, 8 seconds)
> 1 errors, 0 warnings
>
> Did I miss something? - Since I want to fix as much stuff as possible
> by my own, I played a bit around with the linker's settings (there's
> list with libraries at the left and a textarea for entering custom
> options at the right - the "-l"-stuff goes into that textarea) and
> added the "libpjlib-i386-win32-vc8-debug.a"-file to the list at the
> left - that seemed to work a bit better, but I then got this:
>
> [100.0%] mingw32-gcc.exe -LC:\MinGW\lib
> -LC:\MinGW\lib\gcc\mingw32\3.4.5  -o
> ..\bin\pjlib-test-i386-win32-vc8-debug.exe
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\atomic.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\echo_clt.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\errno.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\exception.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\fifobuf.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\file.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\ioq_perf.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\ioq_tcp.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\ioq_udp.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\ioq_unreg.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\list.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\main.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\mutex.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\os.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\pool.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\pool_perf.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\rand.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\rbtree.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\select.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\sleep.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\sock.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\sock_perf.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\string.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\test.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\thread.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\timer.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\timestamp.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\udp_echo_srv_ioqueue.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\udp_echo_srv_sync.o
> output\pjlib-test-i386-win32-vc8-debug\src\pjlib-test\util.o   -s
> -lnetapi32 -lmswsock -lws2_32 -lodbc32 -lodbccp32 -loleaut32 -lole32
> M:\pj-sip\pjlib\lib\libpjlib-i386-win32-vc8-debug.a
> M:\pj-sip\pjlib\lib\libpjlib-i386-win32-vc8-debug.a(os_core_win32.o):
> In function `pj_init':
> M:/pj-sip/pjlib/src/pj/os_core_win32.c:134: undefined reference to
> `WSAStartup at 8'
> M:/pj-sip/pjlib/src/pj/os_core_win32.c:135: undefined reference to
> `WSAGetLastError at 0'
> M:/pj-sip/pjlib/src/pj/os_core_win32.c:135: undefined reference to
> `WSAGetLastError at 0'
> M:/pj-sip/pjlib/src/pj/os_core_win32.c:135: undefined reference to
> `WSAGetLastError at 0'
>
> So, although there's no "-l" before the absolute path to the
> pjlib-file, it seems to work, because the linker doesn't complain
> about "file not found"..
> -- 
> =====================
> = ~ Code is poetry ~
> =====================
> = Martin Baranski
> = Eagle | Eagle3386
> = www.troublezone.net
> = eagle3386 at gmail.com
> = +49 (0)160 93317843
> =====================
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> 





More information about the pjsip mailing list