[gtkmm] static linking
- From: Tamas Hauer <tamas hauer cern ch>
- To: gtkmm-list gnome org
- Subject: [gtkmm] static linking
- Date: 15 Jul 2002 18:32:42 +0200
Hi,
[ This is my first appearance here, I have been using gtkmm-2.0 for
some time. ]
I am trying link a gtkmm program statically but it does not seem to
work, admittedly I am not a gcc-expert. If you could give me a hint
as to what I am doing wrong, I would greatly appreciate.
I am running gcc 3.1 and compiled everything with that. I have built
all the gtk-related packages using
configure --enable-static --enable-shared
Thanks for your help,
Tamas
---------------------------------------------------------------
The program:
/-- gtktest.cc --------------------------------
| #include <gtkmm/main.h>
| #include <gtkmm/fileselection.h>
|
| int main (int argc, char** argv)
| {
| Gtk::Main m(argc,argv);
| m.run( *(Gtk::manage(new Gtk::FileSelection )));
| }
\---------------------------------------------
All the options below are produced by pkg-config.
---------------------------------------------------------------
Compiling: (Works fine)
g++ -I/usr/local/include/gtkmm-2.0 \
-I/usr/local/lib/gtkmm-2.0/include -I/usr/include/gtk-2.0 \
-I/usr/lib/sigc++-1.2/include -I/usr/include/sigc++-1.2 \
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include \
-I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 \
-I/usr/X11R6/include -I/usr/include/atk-1.0 \
-c gtktest.cc
---------------------------------------------------------------
Linking dynamically: ( Works fine )
g++ -L/usr/lib -L/usr/local/lib -L/usr/X11R6/lib \
-lgtkmm-1.3 -lgdkmm-1.3 -latkmm-0.0 -lgtk-x11-2.0 \
-lpangomm-0.0 -lglibmm-1.3 -lsigc-1.1 -lgdk-x11-2.0 -lXext \
-latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangox-1.0 -lX11 \
-lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 \
gtktest.o -o gtktest
---------------------------------------------------------------
Linking statically:
g++ -L/usr/lib -L/usr/local/lib -L/usr/X11R6/lib \
-Xlinker -dn -lgtkmm-1.3 -lgdkmm-1.3 -latkmm-0.0 \
-lgtk-x11-2.0 -lpangomm-0.0 -lglibmm-1.3 \
-lsigc-1.1 -lgdk-x11-2.0 \
-Xlinker -dy -lXext \
-Xlinker -dn -latk-1.0 -lgdk_pixbuf-2.0 \
-Xlinker -dy -lm \
-Xlinker -dn -lpangox-1.0 \
-Xlinker -dy -lX11 \
-Xlinker -dn -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 \
-Xlinker -dy -ldl -lglib-2.0 \
gtktest.o -o gtktest
---------------------------------------------------------------
gtktest.o: In function `main':
gtktest.o(.text+0x2e): undefined reference to `Gtk::Main::Main[in-charge](int&, char**&, bool)'
gtktest.o(.text+0x4c): undefined reference to `Gtk::FileSelection::FileSelection[in-charge]()'
gtktest.o(.text+0x63): undefined reference to `Gtk::Main::run(Gtk::Window&)'
gtktest.o(.text+0xab): undefined reference to `Gtk::Main::~Main [in-charge]()'
gtktest.o(.text+0xc4): undefined reference to `Gtk::Main::~Main [in-charge]()'
collect2: ld returned 1 exit status
---------------------------------------------------------------
thauer:~$ g++ --version
g++ (GCC) 3.1
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
---------------------------------------------------------------
thauer:/usr/lib$ ls -1sh libgtk* libatk* libgdk* libpango*
1.5M libatk-1.0.a
4.0k libatk-1.0.la
0 libatk-1.0.so
0 libatk-1.0.so.0
332k libatk-1.0.so.0.0.1
724k libatk-1.0.so.0.0.2
5.1M libgdk-x11-2.0.a
4.0k libgdk-x11-2.0.la
0 libgdk-x11-2.0.so
0 libgdk-x11-2.0.so.0
1.5M libgdk-x11-2.0.so.0.0.2
2.6M libgdk-x11-2.0.so.0.0.5
636k libgdk_pixbuf-2.0.a
4.0k libgdk_pixbuf-2.0.la
0 libgdk_pixbuf-2.0.so
0 libgdk_pixbuf-2.0.so.0
276k libgdk_pixbuf-2.0.so.0.0.2
348k libgdk_pixbuf-2.0.so.0.0.5
484k libgdk_pixbuf_xlib-2.0.a
4.0k libgdk_pixbuf_xlib-2.0.la
0 libgdk_pixbuf_xlib-2.0.so
0 libgdk_pixbuf_xlib-2.0.so.0
356k libgdk_pixbuf_xlib-2.0.so.0.0.2
304k libgdk_pixbuf_xlib-2.0.so.0.0.5
23M libgtk-x11-2.0.a
4.0k libgtk-x11-2.0.la
0 libgtk-x11-2.0.so
0 libgtk-x11-2.0.so.0
5.6M libgtk-x11-2.0.so.0.0.2
11M libgtk-x11-2.0.so.0.0.5
1.5M libpango-1.0.a
4.0k libpango-1.0.la
0 libpango-1.0.so
0 libpango-1.0.so.0
584k libpango-1.0.so.0.0.1
840k libpango-1.0.so.0.0.3
2.0M libpangoft2-1.0.a
4.0k libpangoft2-1.0.la
0 libpangoft2-1.0.so
0 libpangoft2-1.0.so.0
1.1M libpangoft2-1.0.so.0.0.3
444k libpangox-1.0.a
4.0k libpangox-1.0.la
0 libpangox-1.0.so
0 libpangox-1.0.so.0
276k libpangox-1.0.so.0.0.1
280k libpangox-1.0.so.0.0.3
thauer:/usr/local/lib$ ls -1sh libgtk* libatk* libgdk* libpango*
1.6M libatkmm-0.0.a
4.0k libatkmm-0.0.la
0 libatkmm-0.0.so
0 libatkmm-0.0.so.11
812k libatkmm-0.0.so.11.0.0
0 libgdk-1.2.so.0
828k libgdk-1.2.so.0.9.1
2.1M libgdk.a
4.0k libgdk.la
0 libgdk.so
1.2M libgdk_imlib.a
4.0k libgdk_imlib.la
0 libgdk_imlib.so
0 libgdk_imlib.so.1
440k libgdk_imlib.so.1.9.14
7.7M libgdkmm-1.3.a
4.0k libgdkmm-1.3.la
0 libgdkmm-1.3.so
0 libgdkmm-1.3.so.11
3.7M libgdkmm-1.3.so.11.0.0
0 libgtk-1.2.so.0
3.2M libgtk-1.2.so.0.9.1
9.7M libgtk.a
4.0k libgtk.la
0 libgtk.so
56M libgtkmm-1.3.a
4.0k libgtkmm-1.3.la
0 libgtkmm-1.3.so
0 libgtkmm-1.3.so.11
26M libgtkmm-1.3.so.11.0.0
244k libgtkmm_generate_extra_defs-1.3.a
4.0k libgtkmm_generate_extra_defs-1.3.la
0 libgtkmm_generate_extra_defs-1.3.so
0 libgtkmm_generate_extra_defs-1.3.so.0
196k libgtkmm_generate_extra_defs-1.3.so.0.0.0
4.7M libpangomm-0.0.a
4.0k libpangomm-0.0.la
0 libpangomm-0.0.so
0 libpangomm-0.0.so.11
2.3M libpangomm-0.0.so.11.0.0
--
----------------------------------------------------------------------
-- Tamas Hauer Theory Division, CERN
Tamas Hauer cern ch Geneve 23 Switzerland 1211
http://cern.ch/Tamas.Hauer Tel: (+41)-22-7672424 Fax: 7673850
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]