glitz still linked with configure --without-opengl on wxGTK Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
rex666
Earned a small fee
Earned a small fee
Posts: 20
Joined: Mon Nov 08, 2004 12:15 am

glitz still linked with configure --without-opengl on wxGTK

Post by rex666 » Sun Sep 09, 2007 4:25 am

I'm not using any OpenGL features, and I configured and built my wx libs with --without-opengl, yet the glitz lib is still listed in the libs (wx-config --libs). I am statically linking to the wxWidgets libs, and I am not using any OpenGL features, so I thought the linker would link it out, but that's not the case. When I try to start my app on a machine that does not have glitz installed, I get a missing library message and my app does not start.

What am I doing wrong, and how do I get rid of this dependency?

Thank you
-robin

DavidHart
Site Admin
Site Admin
Posts: 4019
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart » Sun Sep 09, 2007 10:50 am

Hi Robin,

You don't tell us anything about your setup, but have a look at http://forums.wxwidgets.org/viewtopic.php?t=8521 in which Jorg had that problem.

It might be that you too are picking up options from the wrong wx-config, or linking to the wrong libs. For the record, my wx-config output (on a 'local' build of wxGTK-2.8.4 with no mention of opengl in the configuration options) doesn't list libglitz.

Regards,

David

rex666
Earned a small fee
Earned a small fee
Posts: 20
Joined: Mon Nov 08, 2004 12:15 am

Post by rex666 » Mon Sep 10, 2007 7:11 am

Thank you for your help. I already looked at that message, but it did not really address my issue. I'm on SuSE 10.1, using wxWidgets 2.6.3.

If I create a clean build:

% mkdir static_debug
% cd static_debug
% ../configure --disable-opengl
% ./wx-config --libs
-L/home/robin/dev/wxGTK-2.6.3/static_debug/lib -pthread -L/usr/X11R6/lib -Wl,-rpath,/home/robin/dev/wxGTK-2.6.3/static_debug/lib -lwx_gtk2_xrc-2.6 -lwx_gtk2_qa-2.6 -lwx_gtk2_html-2.6 -lwx_gtk2_adv-2.6 -lwx_gtk2_core-2.6 -lwx_base_xml-2.6 -lwx_base_net-2.6 -lwx_base-2.6

OK, seems good.

If I disable the shared library in my build:

% rm -r *
% ../configure --disable-opengl --disable-shared
% ./wx-config --libs
-L/home/robin/dev/wxGTK-2.6.3/static_debug/lib -pthread -L/usr/X11R6/lib /home/robin/dev/wxGTK-2.6.3/static_debug/lib/libwx_gtk2_xrc-2.6.a /home/robin/dev/wxGTK-2.6.3/static_debug/lib/libwx_gtk2_qa-2.6.a /home/robin/dev/wxGTK-2.6.3/static_debug/lib/libwx_gtk2_html-2.6.a /home/robin/dev/wxGTK-2.6.3/static_debug/lib/libwx_gtk2_adv-2.6.a /home/robin/dev/wxGTK-2.6.3/static_debug/lib/libwx_gtk2_core-2.6.a /home/robin/dev/wxGTK-2.6.3/static_debug/lib/libwx_base_xml-2.6.a /home/robin/dev/wxGTK-2.6.3/static_debug/lib/libwx_base_net-2.6.a /home/robin/dev/wxGTK-2.6.3/static_debug/lib/libwx_base-2.6.a -pthread -L/usr/X11R6/lib -L/opt/gnome/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lfreetype -lfontconfig -lXrender -lX11 -lXext -lpng12 -lglitz -lgthread-2.0 -lglib-2.0 -lXinerama -lXxf86vm -lpng -ljpeg -ltiff -lexpat -lz -ldl -lm

There it is. I disabled opengl, but glitz is still listed in the list of libraries to link against. Normally, I would think this wouldn't be a problem, because I disabled it in the configuration, so there should be nothing to link, and it should go away. And, if I copy the list of libs manually into my makefile, and remove the -lglitz dependency, my program still links just fine, and runs just fine on a machine that does not have glitz installed.

I'm guessing that glitz has some static data that is included just by the lib being linked into my app, which creates a dependency I don't want. Is there some way to get the wx-config script not to believe that glitz is still a dependency for the wxWidgets code, when opengl has been disabled? Or do I have to abandon using wx-config and just link manually to the libs I actually need? Is there something else I missed?

Thanks
-robin

DavidHart
Site Admin
Site Admin
Posts: 4019
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart » Fri Sep 14, 2007 8:12 pm

Sorry about the delay.
I'm guessing that glitz has some static data that is included just by the lib being linked into my app, which creates a dependency I don't want.
I checked with SuSE 10.2, and static builds do this for me too. However they don't with SuSE 9.3, nor with Ubuntu or Sabayon.

The SuSE dependency setup was changed for the worse in (?) 10.1, with everything seeming to depend on everything else (one reason why I'm going to switch away from it). Your problem is probably a consequence of this.

One solution would be to create your static-build configure on a non-SuSE distro. However, I'm not sure why you're trying to make static builds anyway: you realise that, for reasons to do with library versions and location, a binary created on one distro often won't work on another?

Post Reply