Re: Link gtkmm static

"Jan Niklas Hasse" <[email protected]>
Newsgroups gmane.comp.autopackage.devel
Message-ID <[email protected]>
On Dec 27, 2007 5:42 PM, Taj Morton <[email protected]> wrote:

> On Dec 26, 2007 3:26 PM, Jan Niklas Hasse <[email protected]> wrote:
> > Hi,
> > Does someone have an idea why it doesn't work? I still couldn't solve
> the
> > problem :(
> > Here's my default.apspec again:
> >
> >
> > [BuildPrepare]
> >  export APBUILD_STATIC="gtkmm-2.4 gdkmm-2.4 atkmm-1.6 pangomm-1.4
> > cairomm-1.0 glibmm-2.4"
> > apg++ `pkg-config gtkmm-2.4 --cflags --libs` main.cpp binreloc.o -o
> > bin/hallowelt
> > ./install.sh $build_root
> >
> > The binary still depends on libgtkmm-2.4.so.1...
> > How to use APBUILD_STATIC correctly?
> It looks like you're doing everything correctly. It could be that
> something else is pulling in gtkmm. How are you checking what depends
> on the created binary? Try running objdump -x filename|grep NEEDED to
> see what is actually needed.
>
> It's also highly possible that it's a bug in apgcc. What is the final
> link line? Set APBUILD_DEBUG=1 to get the gcc line that is actually
> run.
>
> - Taj
>

Hi,

Here's the output when i enable APBUILD_DEBUG:

jhasse@jnsamsung:/media/gutsy/home/jhasse/C++/hallowelt$ export
APBUILD_DEBUG=1
jhasse@jnsamsung:/media/gutsy/home/jhasse/C++/hallowelt$ export
APBUILD_STATIC="gtkmm-2.4 gdkmm-2.4 atkmm-1.6 pangomm-1.4 cairomm-1.0
glibmm-2.4"
jhasse@jnsamsung:/media/gutsy/home/jhasse/C++/hallowelt$ apg++ `pkg-config
gtkmm-2.4 --cflags --libs` main.cpp binreloc.o -o bin/hallowelt
# apg++ -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include
-I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include
-I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include
-I/usr/include/pangomm-1.4 -I/usr/include/atkmm-1.6
-I/usr/include/gtk-2.0-I/usr/include/sigc++-
2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-
2.0/include -I/usr/lib/gtk-2.0/include
-I/usr/include/cairomm-1.0-I/usr/include/pango-
1.0 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12
-I/usr/include/atk-1.0 -lgtkmm-2.4 -lgdkmm-2.4 -latkmm-1.6 -lgtk-x11-2.0 -
lpangomm-1.4 -lcairomm-1.0 -lglibmm-2.4 -lsigc-2.0 -lgdk-x11-2.0
-latk-1.0-lgdk_pixbuf-
2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi
-lXrandr -lXcursor -lXfixes -lpango-1.0 -lcairo -lX11 -lgobject-2.0 -
lgmodule-2.0 -ldl -lglib-2.0 main.cpp binreloc.o -o bin/hallowelt
# Situation: compile and link
# g++ -I/usr/include/apbuild -include /usr/include/apbuild/apsymbols.h
-DAPBUILD_VERSION="2.0.5" -fno-stack-protector
main.cpp-Wl,--enable-new-dtags,--rpath,${ORIGIN}/../lib,--rpath,${ORIGIN}/../lib/autopackage
-Wl,--hash-style=both -shared-libgcc binreloc.o -Wl,--as-needed
-I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/include/glibmm-
2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-
2.4/include -I/usr/include/pangomm-1.4
-I/usr/include/atkmm-1.6-I/usr/include/gtk-
2.0 -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include
-I/usr/include/cairomm-1.0 -I/usr/include/pango-1.0 -I/usr/include/cairo
-I/usr/include/freetype2 -I/usr/include/libpng12
-I/usr/include/atk-1.0-lcairo -lstdc++ -lm -lc -lgcc_s -
lgtkmm-2.4 -lgdkmm-2.4 -latkmm-1.6 -lgtk-x11-2.0 -lpangomm-1.4 -lcairomm-1.0-
lglibmm-2.4 -lsigc-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -
lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr
-lXcursor -lXfixes -lpango-1.0 -lcairo -lX11 -lgobject-2.0 -lgmodule-2.0-ldl -
lglib-2.0 -o bin/hallowelt
jhasse@jnsamsung:/media/gutsy/home/jhasse/C++/hallowelt$ objdump -x
bin/hallowelt|grep NEEDED  NEEDED      libstdc++.so.6
  NEEDED      libgcc_s.so.1
  NEEDED      libgtkmm-2.4.so.1
  NEEDED      libglibmm-2.4.so.1
  NEEDED      libc.so.6
jhasse@jnsamsung:/media/gutsy/home/jhasse/C++/hallowelt$

Hope it helps you. The output of apg++ is yellow, btw.

Jan-Nik
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.