delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/11/13/13:25:37

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Thu, 13 Nov 2003 13:25:14 -0500
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Problems using WIN32 api
Message-ID: <20031113182514.GB28184@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <3418F3471F1CA4409901547349FFAE2E0CE2C5 AT ftrdmel2 DOT rd DOT francetelecom DOT fr> <Pine DOT GSO DOT 4 DOT 56 DOT 0311131135490 DOT 9584 AT eos>
Mime-Version: 1.0
In-Reply-To: <Pine.GSO.4.56.0311131135490.9584@eos>
User-Agent: Mutt/1.4.1i

On Thu, Nov 13, 2003 at 11:40:37AM -0600, Brian Ford wrote:
>I'll take a shot at a few of these I know.
>
>On Thu, 13 Nov 2003, zze-BDE balg011 VAUCHER Laurent DvSI/SIReS/GRE wrote:
>
>>   I'm trying to understand how to build an application using
>> both Cygwin and (some) WIN32 APIs and I stumbled into a
>> problem using exactly whet the FAQ says (even if it says
>> it is not up to date).
>>
>>  Example program : main.c
>> --------------------------
>> #include <windows.h>
>> int main(int arc, char *argv[])
>> {
>>   BOOL sm;
>>   /* The following function is in USER32.DLL */
>>   SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &sm, 0);
>>   return 0;
>> }
>>
>> I tried compiling like the FAQ says I should :
>> > gcc -o main main.c -luser32
>>
>WFM.  Try gcc --verbose -o main main.c -luser32 and see what it is finding
>for -luser32.
>
>> All I get is "undefined reference to `SystemParametersInfoA AT 16`"
>> Since it seems that the 'interface' libs live in /usr/lib/w32api,
>> I tried to add -L/usr/lib/w32api, but the result is the same.
>>
>They should be searched automatically.

As should libuser32.a.  There is no reason to include it on the command line.

cgf

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

- Raw text -


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