Gcc problem on FC6

Peter Gordon peter at thecodergeek.com
Tue Jun 19 05:20:54 UTC 2007


On Mon, 2007-06-18 at 21:59 -0700, Les wrote:
> /tmp/cc2fblEI.o: In function `main':
> GuiExample.cpp:(.text+0x1e): undefined reference to `XOpenDisplay'
> GuiExample.cpp:(.text+0x102): undefined reference to
> `XCreateSimpleWindow'
> GuiExample.cpp:(.text+0x11f): undefined reference to `XSelectInput'
> GuiExample.cpp:(.text+0x131): undefined reference to `XMapWindow'
> GuiExample.cpp:(.text+0x153): undefined reference to `XCreateGC'
> GuiExample.cpp:(.text+0x16f): undefined reference to `XSetForeground'
> GuiExample.cpp:(.text+0x181): undefined reference to `XNextEvent'
> GuiExample.cpp:(.text+0x1c4): undefined reference to `XDrawLine'
> GuiExample.cpp:(.text+0x1cf): undefined reference to `XFlush'
> collect2: ld returned 1 exit status
> make: *** [GuiExample] Error 1
> 

These look like linker errors; make sure you have the libX11-devel
package installed and that your CXXFLAGS setting (if needed) includes
the "-lX11" switch so that the linker can properly find the right shared
library to link to.

> [...]
> but that would mean that the standard loader execution is messed up,
> because it should look in /usr/lib for the associated ".a" files that
> match the headers.

As an aside, Fedora's policy as I understand it is to explicitly exclude
such static libraries from the packaging unless otherwise absolutely
necessary. Once you install libX11-devel, you'll see various libX11.so
symlinks in your /usr/lib directory (or /usr/lib64 if using a 64-bit
arch). These are how the dynamic linker finds the appropriate library.

Hope that helped.
-- 
Peter Gordon (codergeek42)
GnuPG Public Key ID: 0xFFC19479 / Fingerprint:
  DD68 A414 56BD 6368 D957 9666 4268 CB7A FFC1 9479
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20070618/8a601a87/attachment-0001.sig>


More information about the fedora-list mailing list