I've got a weird problem, I can't seem to find and solve. When combining gtkmm and bobcat, I get the following error:
wrong XOpenDisplay called. Aborting
The problem is caused by linking to the bobcat library. Compiling the following code:
#include <gtkmm.h>
#include <bobcat/errno>
int main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
Gtk::Window window;
Gtk::Main::run(window);
}
Will give rise to this problem, when compiling it with "-lbobcat `pkg-config --cflags --libs gtkmm-2.4` and not when compiling it without -lbobcat.
I could not get a backtrace on this, but for general information, here are some of the things I'm working with: Ubuntu, libbobcat1-dev (1.15.0-1), gtkmm-2.4.
The final compilation command I use is:
g++ -Wall -g -c -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 -o "./o/test.o" "./test.cc"
Explanation of the gtk/bobcat XOpenDisplay problem
Logged In: YES
user_id=575272
Originator: NO
The problem is solved when the X11 library is linked explicitly to the program. Apparently that doesn't happen when the gtk libs are linked, even though they must cal XOpenDisplay() somewhere. So, link the program using, e.g., -lX11 `pkg-config --cflags --libs gtkmm-2.4` -lbobcat. The error message is generated by bobcat, and will be improved in release 1.17.3. See also the file README.X11
File Added: README.X11