This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
RE: Linking with libX11.a and libXt.a
- To: "'cygwin-xfree at cygwin dot com'" <cygwin-xfree at cygwin dot com>
- Subject: RE: Linking with libX11.a and libXt.a
- From: Suhaib Siddiqi <ssiddiqi at inspirepharm dot com>
- Date: Mon, 1 Oct 2001 20:42:55 -0400
> -----Original Message-----
> From: Adam Stallard [mailto:adam@aspen.mine.nu]
> Sent: Monday, October 01, 2001 8:21 PM
> To: cygwin-xfree@cygwin.com
> Subject: Linking with libX11.a and libXt.a
>
> Hi,
>
> I've been able to compile my X-Windows programs using the dynamic
> libraries only, such as libX11.dll.
>
> I would like to to be able to use static forms if possible, especially
> since the Xt library does not come with cygwin/XFree in the dynamic
> form.
>
> Here is an example:
>
> #include <X11/Xlib.h>
>
> int main(){
> XOpenDisplay(NULL);
> }
>
> This compiles with: (uses libX11.dll)
>
> gcc -L/usr/X11R6/bin -lX11 xtest.c
>
> but if I use: (uses libX11.a)
>
> gcc -L/usr/X11R6/lib -lX11 xtest.c
>
huh? libX11.a is just an import library for libX11.dll (it is not an static
version of libX11)
I do not know what you did
Try gcc xtest.c -L/usr/X11R6/lib -lX11
Suhaib
> ld returns an undefined reference to XOpenDisplay
>
> If someone could enlighten me on how I should be using gcc for cygwin
> to
> make this work, that would be great.
>
> Thanks a lot!
>
> Adam Stallard
>