This is a side -issue to begin with...
I have been trying to compile mplayer without success, but that's beside the
point. The point being that the INSTALL instructions state very strongly that
gcc v 2.96 is buggy and would (should I force it to be used) cause a buggy
application.
They go further to say that RedHat's 3.0 and 3.01 rpm was compiled with 2.96
and therefore is also buggy.
So, for peace of mind, download 2.95gcc and cpp rpms, install those (you will
have to use --force on rpm) , then
get the gcc 3.01 source code and compile that with the 2.95 compiler. In that
way you end up with a good compiler and it will elliminate one possible source
of problems. Follow the gcc install instructions closely - i.e. use a separate
directory for doing the "configure" command.
Note that there could be a difference in the installation of gcc - possible
/usr/bin/gcc for the 2.95 compiler, and /usr/local/bin for the 3.01. That's
just something to be aware of.
You can check your compiler version like this:
gcc --version
which gcc
Now, to your specific problem.
".h" files contain compile-time declarations. In this case, to define an
external function to your XOpenDisplay function. Including the ".h" file
gets you a compiled object only.
At link-time, "ld" looks for library files. The code expects to find a
specific library and then,
in that library (/usr/lib/libXYZ.so for instance), it expects to find the
actual code that executes the desired external function. That
library, or the function in that library that you request, is missing or not
in a search path.
This could be because it's a new addition to the library, and you need to
upgrade the library, or it could be that the library does not exist, or in
your case, more likely that you need to tell the linker where to find the
library.
The best thing for you to do is
man ld
and read that.
Look for this section in particular:
-Lsearchdir
This command adds path searchdir to the list of
paths that ld will search for archive libraries.
You may use this option any number of times.
The default set of paths searched (without being
specified with -L) depends on what emulation mode
ld is using, and in some cases also on how it was
configured. The paths can also be specified in a
link script with the SEARCH_DIR command.
J
On Mon, 17 Sep 2001 06:20, you wrote:
> I'm writing a small program that's supposed to display a window in my WM's
> dock, but I can't get the program to compile. ld complains about an
> undefined reference to the XOpenDisplay function even though I've
> #include'd X11/Xlib.h, which contains it. System is Mandrake 8.0, gcc
> 2.96, and XFree86 4.0.3. What could be causing this, and how can I go
> about fixing it? Any help you all could give would be greatly appreciated.
> Also, is there a FAQ or mailing list archive I could look through instead
> of asking already-answered questions and wasting everyone's time? thanks
> in advance.
>
> -Dan
> _______________________________________________
> Newbie mailing list
> [EMAIL PROTECTED]
> *** To unsubscribe , or change message options, see:
> http://XFree86.Org/mailman/listinfo/newbie
_______________________________________________
Newbie mailing list
[EMAIL PROTECTED]
*** To unsubscribe , or change message options, see:
http://XFree86.Org/mailman/listinfo/newbie