Problems using WIN32 api

zze-BDE balg011 VAUCHER Laurent DvSI/SIReS/GRE openup01@rd.francetelecom.com
Thu Nov 13 16:49:00 GMT 2003


  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

All I get is "undefined reference to `SystemParametersInfoA@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.

In last resort, I did this awful thing :
> gcc -o main main.c /usr/lib/w32api/libuser32.a

which works !! But I'm still not satisfied with it, because
it does not work on another libtool based project (pango),
saying that I'm trying to include a static lib when building
a dynamic one. So libtool refuses to pass things like
/usr/lib/w32api/libuser32.a down to gcc and I need to
repair the gcc command line manually.

And I've got some more questions :
- are the /usr/lib/w32api/libXXX.a real static libs (with code)
   or only interface to the system DLLs?
- what's the difference with libXXX.dll.a?
- why is -luser32 or -lgdi32 not honored?
- would it be difficult to create .la files for those
   Win32 api, so that libtool would be nice with them?
- is someone interested in a glib/gtk+ cygwin package
   (not a native Win32 one)?


Laurent Vaucher.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 36269 bytes
Desc: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20031113/0db00dbf/attachment.obj>
-------------- next part --------------
--
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/


More information about the Cygwin mailing list