Re: Static linking doesn't work
- From: Havoc Pennington <hp redhat com>
- To: "Felix E. Klee" <felix klee inka de>
- Cc: gtk-app-devel <gtk-app-devel-list gnome org>
- Subject: Re: Static linking doesn't work
- Date: 29 Jun 2001 16:07:34 -0400
"Felix E. Klee" <felix klee inka de> writes:
compiling my GTK-application worked fine until I added the -static flag
to gcc. Now, I get many error messages that look like this:
/usr/lib/libgtkmm.a(accellabel.o): In function
`Gtk::AccelLabel::isA(Gtk::Object *)':
accellabel.o(.text+0x1a8): undefined reference to
`gtk_accel_label_get_type'
Here are the libraries that I include:
-lgtk -lgdk -lgtkmm -lgdkmm -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm
-lsigc -lpthread -lgthread -lgtkextramm -lgtkextra
What am I doing wrong?
Static linking cares about the order of the libraries on the link
line. They should be ordered according to dependency. I don't remember
the direction - either library A that depends on B must come before B,
or vice versa.
In any case, you have it mixed up - the right thing is one of these
two orders:
-lgtkmm -lgtk -lX11
or:
-lX11 -lgtk -lgtkmm
not:
-lgtk -lgtkmm -lX11
A quick look at the gcc docs should tell you which order to use.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]