Re: Statically linking Gtkmm



Joe Van Dyk wrote:
Hi,

I'm trying to statically link the radar example.  Any chance someone
could provide me with the appropriate g++ line?

Here's a quick sample of my problem.  Did I miss a library or get
something out of order?

Thanks,
Joe

g++ -o radar radar.cc \
`pkg-config gtkmm-2.4 --cflags` \
/tmp/builds/glib/2.4.8/rhel3/lib/libglib-2.0.a     \
/tmp/builds/glib/2.4.8/rhel3/lib/libgobject-2.0.a \
/tmp/builds/glib/2.4.8/rhel3/lib/libgmodule-2.0.a  \
/tmp/builds/glib/2.4.8/rhel3/lib/libgthread-2.0.a \
/tmp/builds/gtk/2.4.14/rhel3/lib/libgdk_pixbuf-2.0.a       \
/tmp/builds/gtk/2.4.14/rhel3/lib/libgdk-x11-2.0.a \
/tmp/builds/gtk/2.4.14/rhel3/lib/libgdk_pixbuf_xlib-2.0.a  \
/tmp/builds/gtk/2.4.14/rhel3/lib/libgtk-x11-2.0.a \
/tmp/builds/atk/1.8.0/rhel3/lib/libatk-1.0.a  \
/tmp/builds/libsigc++/2.0.17/rhel3/lib/libsigc-2.0.a \
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a  \
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libpangomm-1.4.a \
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libatkmm-1.6.a  \
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgtkmm-2.4.a  \
/tmp/builds/glibmm/2.4.8/rhel3/lib/libglibmm-2.4.a  \
/tmp/builds/glibmm/2.4.8/rhel3/lib/libglibmm-2.4.a


/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x19):
In function `Gdk::Color::Color()':
/root/gtkmm-2.4.11/gdk/gdkmm/color.cc:38: undefined reference to
`gdk_color_copy'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x45):
In function `Gdk::Color::Color()':
/root/gtkmm-2.4.11/gdk/gdkmm/color.cc:38: undefined reference to
`gdk_color_copy'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x75):
In function `Gdk::Color::Color(Glib::ustring const&)':
/root/gtkmm-2.4.11/gdk/gdkmm/color.cc:44: undefined reference to
`gdk_color_copy'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0xad):
In function `Gdk::Color::Color(Glib::ustring const&)':
/root/gtkmm-2.4.11/gdk/gdkmm/color.cc:44: undefined reference to
`gdk_color_copy'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x4b7):
In function `Gdk::Color::set(Glib::ustring const&)':
../../gdk/gdkmm/color.h:67: undefined reference to `gdk_color_parse'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x61d):
In function `Gdk::Color::Color(Gdk::Color const&)':
/root/gtkmm-2.4.11/gdk/gdkmm/color.cc:248: undefined reference to
`gdk_color_copy'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x645):
In function `Gdk::Color::Color(Gdk::Color const&)':
/root/gtkmm-2.4.11/gdk/gdkmm/color.cc:248: undefined reference to
`gdk_color_copy'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x668):
In function `Gdk::Color::Color(_GdkColor*, bool)':
/root/gtkmm-2.4.11/gdk/gdkmm/color.cc:256: undefined reference to
`gdk_color_copy'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x690):
In function `Gdk::Color::Color(_GdkColor*, bool)':
/root/gtkmm-2.4.11/gdk/gdkmm/color.cc:256: undefined reference to
`gdk_color_copy'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x761):
In function `Gdk::operator==(Gdk::Color const&, Gdk::Color const&)':
../../gdk/gdkmm/color.h:70: undefined reference to `gdk_color_equal'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x785):
In function `Gdk::operator!=(Gdk::Color const&, Gdk::Color const&)':
../../gdk/gdkmm/color.h:70: undefined reference to `gdk_color_equal'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x56a):
In function `Gdk::Color::rgb_find_color(Glib::RefPtr<Gdk::Colormap>
const&)':
../../gdk/gdkmm/colormap.h:89: undefined reference to `gdk_rgb_find_color'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x5f9):
In function `Gdk::Color::get_type()':
/root/gtkmm-2.4.11/gdk/gdkmm/color.cc:241: undefined reference to
`gdk_color_get_type'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x701):
In function `Gdk::Color::~Color()':
/root/gtkmm-2.4.11/gdk/gdkmm/color.cc:268: undefined reference to
`gdk_color_free'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x71d):
In function `Gdk::Color::~Color()':
/root/gtkmm-2.4.11/gdk/gdkmm/color.cc:268: undefined reference to
`gdk_color_free'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(color.o)(.text+0x749):
In function `Gdk::Color::gobj_copy() const':
/root/gtkmm-2.4.11/gdk/gdkmm/color.cc:280: undefined reference to
`gdk_color_copy'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x22):
In function `Gdk::Colormap::Colormap(Glib::RefPtr<Gdk::Visual> const&,
bool)':
../../gdk/gdkmm/visual.h:142: undefined reference to `gdk_colormap_new'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x2c):../../gdk/gdkmm/visual.h:142:
undefined reference to `g_type_check_instance_cast'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0xa8):
In function `Gdk::Colormap::Colormap(Glib::RefPtr<Gdk::Visual> const&,
bool)':
../../gdk/gdkmm/visual.h:142: undefined reference to `gdk_colormap_new'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0xb2):../../gdk/gdkmm/visual.h:142:
undefined reference to `g_type_check_instance_cast'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x17b):
In function `Gdk::Colormap_Class::init()':
/root/gtkmm-2.4.11/gdk/gdkmm/colormap.cc:75: undefined reference to
`gdk_colormap_get_type'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x4fb):
In function `Gdk::Colormap::get_system()':
/root/gtkmm-2.4.11/gdk/gdkmm/colormap.cc:139: undefined reference to
`gdk_colormap_get_system'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x5ba):
In function `Gdk::Colormap::alloc_color(Gdk::Color&, bool, bool)':
../../gdk/gdkmm/colormap.h:89: undefined reference to `gdk_colormap_alloc_color'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x624):
In function `Gdk::Colormap::get_visual()':
../../gdk/gdkmm/colormap.h:89: undefined reference to `gdk_colormap_get_visual'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x6a0):
In function `Gdk::Colormap::get_visual() const':
../../gdk/gdkmm/colormap.h:92: undefined reference to `gdk_colormap_get_visual'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x764):
In function `Gdk::Colormap::get_screen()':
../../gdk/gdkmm/colormap.h:89: undefined reference to `gdk_colormap_get_screen'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x7e0):
In function `Gdk::Colormap::get_screen() const':
../../gdk/gdkmm/colormap.h:92: undefined reference to `gdk_colormap_get_screen'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x48d):
In function `Gdk::Colormap::get_base_type()':
/root/gtkmm-2.4.11/gdk/gdkmm/colormap.cc:128: undefined reference to
`gdk_colormap_get_type'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x594):
In function `Gdk::Colormap::alloc_colors(Glib::ArrayHandle<Gdk::Color,
Gdk::ColorTraits>&, int, bool, bool, Glib::ArrayHandle<bool,
Glib::Container_Helpers::TypeTraits<bool> >&)':
../../gdk/gdkmm/colormap.h:89: undefined reference to
`gdk_colormap_alloc_colors'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x5e8):
In function `Gdk::Colormap::free_colors(Gdk::Color&, int)':
../../gdk/gdkmm/colormap.h:89: undefined reference to `gdk_colormap_free_colors'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(colormap.o)(.text+0x608):
In function `Gdk::Colormap::query_color(unsigned long, Gdk::Color&)':
../../gdk/gdkmm/colormap.h:89: undefined reference to `gdk_colormap_query_color'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(drawable.o)(.text+0x2f):
In function `Gdk::Drawable::draw_points(Glib::RefPtr<Gdk::GC const>
const&, Glib::ArrayHandle<Gdk::Point,
Glib::Container_Helpers::TypeTraits<Gdk::Point> > const&)':
../../gdk/gdkmm/drawable.h:135: undefined reference to `gdk_draw_points'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(drawable.o)(.text+0x73):
In function `Gdk::Drawable::draw_lines(Glib::RefPtr<Gdk::GC const>
const&, Glib::ArrayHandle<Gdk::Point,
Glib::Container_Helpers::TypeTraits<Gdk::Point> > const&)':
../../gdk/gdkmm/drawable.h:135: undefined reference to `gdk_draw_lines'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(drawable.o)(.text+0xcb):
In function `Gdk::Drawable::draw_polygon(Glib::RefPtr<Gdk::GC const>
const&, bool, Glib::ArrayHandle<Gdk::Point,
Glib::Container_Helpers::TypeTraits<Gdk::Point> > const&)':
../../gdk/gdkmm/drawable.h:135: undefined reference to `gdk_draw_polygon'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(drawable.o)(.text+0x1cb):
In function `Gdk::Drawable_Class::init()':
/root/gtkmm-2.4.11/gdk/gdkmm/drawable.cc:113: undefined reference to
`gdk_drawable_get_type'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(drawable.o)(.text+0x6d4):
In function `Gdk::Drawable::get_colormap()':
../../gdk/gdkmm/drawable.h:135: undefined reference to
`gdk_drawable_get_colormap'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(drawable.o)(.text+0x750):
In function `Gdk::Drawable::get_visual()':
../../gdk/gdkmm/drawable.h:135: undefined reference to `gdk_drawable_get_visual'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(drawable.o)(.text+0xdff):
In function `Gdk::Drawable::get_image(int, int, int, int) const':
../../gdk/gdkmm/drawable.h:138: undefined reference to `gdk_drawable_get_image'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(drawable.o)(.text+0xe2f):
In function `Gdk::Drawable::get_clip_region() const':
../../gdk/gdkmm/drawable.h:138: undefined reference to
`gdk_drawable_get_clip_region'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(drawable.o)(.text+0xe5f):
In function `Gdk::Drawable::get_visible_region() const':
../../gdk/gdkmm/drawable.h:138: undefined reference to
`gdk_drawable_get_visible_region'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(drawable.o)(.text+0x11d0):
In function `Gdk::Drawable::get_screen()':
../../gdk/gdkmm/drawable.h:135: undefined reference to `gdk_drawable_get_screen'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(drawable.o)(.text+0x124c):
In function `Gdk::Drawable::get_screen() const':
../../gdk/gdkmm/drawable.h:138: undefined reference to `gdk_drawable_get_screen'
/tmp/builds/gtkmm/2.4.11/rhel3/lib/libgdkmm-2.4.a(drawable.o)(.text+0x1310):
In function `Gdk::Drawable::get_display()':
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

hi,

I've got build gtkmm staticly, you will need to setup your own build environment, and configure all your involved packages with --enable-static and --disable-shared or something like --static depending on the arguments the configure scribt takes...

you also have to take care that the *.pc files are correct and to change the pkg-config search path... my target was to build an gtkmm application that only links dynamicly to X , libC and stdc++ for that i needed to the following static packackes:

- expat, zlib, gettext, freetype, fontconfig, libpng, cairo, glib, pango, atk, gtk, libsigc, glibmm, gtkmm

it's working but it toke me a whole week to get it working so it's really tricky...

good luck

--
Alexander Gehlert - Intern
reply to : ageh raritan com

Peppercon AG
Software Development
Scheringerstrasse 1
08056 Zwickau
Germany






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]