This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Compiling with netapilib


Hi,

I'm trying to use gcc 3.4.4 to compile the Microsoft C sample at
http://msdn.microsoft.com/en-us/library/aa370663(VS.85).aspx to build a
small test program that makes the "NetWkstaGetInfo" Windows NetAPI
request. The Cygwin gcc library includes a libnetapi32.a library that
seems to include that function (see below) but linking with it gives an
"undefined reference to `_NetWkstaGetInfo@12'" error. Any idea what I am
missing - is there some other library that I need to link in too?

[Temp]: gcc -l netapi32 -o winTst2.exe winTst2.c
/cygdrive/c/Users/IPULES~2/Temp/cc4my5mj.o:winTst2.c:(.text+0x9a):
undefined reference to `_NetWkstaGetInfo@12'
/cygdrive/c/Users/IPULES~2/Temp/cc4my5mj.o:winTst2.c:(.text+0x169):
undefined reference to `_NetApiBufferFree@4'
collect2: ld returned 1 exit status
[Temp]: 
[Temp]: nm /usr/lib/w32api/libnetapi32.a | grep NetWkstaGetInfo
00000000 T _NetWkstaGetInfo@12
00000000 I __imp__NetWkstaGetInfo@12
[Temp]: 
[Temp]: nm /usr/lib/w32api/libnetapi32.a | grep NetApiBufferFree
00000000 T _NetApiBufferFree@4
00000000 I __imp__NetApiBufferFree@4
[Temp]:

Ian

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]