delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/19/14:13:49

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: Compiling with netapilib
Date: Sun, 19 Jul 2009 11:13:32 -0700
Message-ID: <3A64AD910BEC5B438CE38CA499168FFE03F0ABA7@US0EXB07.us.sonicwall.com>
From: "Ian Puleston" <ipuleston AT SonicWALL DOT com>
To: <cygwin AT cygwin DOT com>
X-Mlf-Version: 7.1.0.1805
X-Mlf-UniqueId: o200907191807420129076
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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 AT 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 AT 12'
/cygdrive/c/Users/IPULES~2/Temp/cc4my5mj.o:winTst2.c:(.text+0x169):
undefined reference to `_NetApiBufferFree AT 4'
collect2: ld returned 1 exit status
[Temp]:=20
[Temp]: nm /usr/lib/w32api/libnetapi32.a | grep NetWkstaGetInfo
00000000 T _NetWkstaGetInfo AT 12
00000000 I __imp__NetWkstaGetInfo AT 12
[Temp]:=20
[Temp]: nm /usr/lib/w32api/libnetapi32.a | grep NetApiBufferFree
00000000 T _NetApiBufferFree AT 4
00000000 I __imp__NetApiBufferFree AT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019