Advertisement

Xlib? Where's the lib file?

Started by May 23, 2003 10:07 PM
3 comments, last by avianRR 21 years, 5 months ago
Ok, I tried writing my first xlib program. It compiles but won''t link. Here''s the command I type. g++ XTest.cpp -l X11 -o XTest I get the following error. /usr/bin/ld: cannot find -lX11 collect2: ld returned 1 exit status I tried finding the X11 file in the /usr/lib directory but can''t find it anywhere. Can anyone tell me if I got the right lib and if so what rpm it''s supposed to be in. If it''s not the right lib what one do I need. I''m running Mandrake 9.0
------------------------------Piggies, I need more piggies![pig][pig][pig][pig][pig][pig]------------------------------Do not invoke the wrath of the Irken elite. [flaming]
Have a look in /usr/X11R6/lib/

If that doesn''t work try the command:
> locate libX11
It''ll show the full path if it finds a full or partial match to that name.


The following statement is true. The previous statement is false.
My stuff.Shameless promotion: FreePop: The GPL god-sim.
Advertisement
Oh, and make sure you have the "dev" rpms. Often packagers will seperate stuff like X into the compiled libs and the development files like headers and linkable libs, etc.

Since the compiler has already gotten to the linking stage (ie it found your headers) you might already have these rpms.

The following statement is true. The previous statement is false.
My stuff.Shameless promotion: FreePop: The GPL god-sim.
quote: Original post by Doc
Oh, and make sure you have the "dev" rpms. Often packagers will seperate stuff like X into the compiled libs and the development files like headers and linkable libs, etc.

Since the compiler has already gotten to the linking stage (ie it found your headers) you might already have these rpms.


Yep, the XFree86-libs-4.2.1-3mdk.i586.rpm and XFree86-devel-4.2.1-3mdk.i586.rpm files are installed and I can''t find any others that would likely have the file in it.

all locate found were the libX11.so and libX11.so.6 and libX11.so.6.2 files. if I searched for X11 instead of libX11 I got a LOT of stuff but couldn''t fine anything that looked like a library file.
------------------------------Piggies, I need more piggies![pig][pig][pig][pig][pig][pig]------------------------------Do not invoke the wrath of the Irken elite. [flaming]
ok I got it to work. had to add "-L/usr/X11R6/lib" to the compiler options.
------------------------------Piggies, I need more piggies![pig][pig][pig][pig][pig][pig]------------------------------Do not invoke the wrath of the Irken elite. [flaming]

This topic is closed to new replies.

Advertisement