2

I would appreciate help to get "gtkmm-3.0" (the C++ interface for the Gtk+ 3 library) running on Fedora 30. I had no problems with it in Fedora 29.

I installed gtkmm using:

dnf install gtk3 gtk3-devel gtkmm30 gtkmm30-devel

To test it I used the simple .cpp file commonly available on the Net, e.g. https://gtkmm-tutorial.blogspot.com/2016/05/how-to-install-gtkmm-on-CENTOS-7-RedHat-Fedora-in-3-steps.html

#include <gtkmm.h>
int main(int argc, char *argv[])
{
  Gtk::Main kit(argc, argv);
  Gtk::Window GtkmmTutorial;
  GtkmmTutorial.set_default_size(400, 400);
  Gtk::Main::run(GtkmmTutorial);
  return 0;
}

Given the file name "GtkmmTutorial.cpp", I compiled it from the same directory using:

g++ GtkmmTutorial.cpp -o GtkmmTutorial `pkg-config gtkmm-3.0 --cflags --libs`

Compilation failed with the error message:

Package gtkmm-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtkmm-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtkmm-3.0', required by 'virtual:world', not found
GtkmmTutorial.cpp:1:10: fatal error: gtkmm.h: No such file or directory
    1 | #include <gtkmm.h>
      |          ^~~~~~~~~
compilation terminated.

I found gtkmm-3.0.pc and gdkmm-3.0.pc in "/usr/lib/pkgconfig/", so as instructed did:

export PKG_CONFIG_PATH="/usr/share/pkgconfig"

At the next attempt to compile I got this error message:

/usr/bin/ld: skipping incompatible /usr/lib/libgtkmm-3.0.so when searching for -lgtkmm-3.0
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/9/../../../libgtkmm-3.0.so when searching for -lgtkmm-3.0
/usr/bin/ld: skipping incompatible //lib/libgtkmm-3.0.so when searching for -lgtkmm-3.0
/usr/bin/ld: skipping incompatible //usr/lib/libgtkmm-3.0.so when searching for -lgtkmm-3.0
/usr/bin/ld: cannot find -lgtkmm-3.0
/usr/bin/ld: skipping incompatible /usr/lib/libgdkmm-3.0.so when searching for -lgdkmm-3.0
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/9/../../../libgdkmm-3.0.so when searching for -lgdkmm-3.0
/usr/bin/ld: skipping incompatible //lib/libgdkmm-3.0.so when searching for -lgdkmm-3.0
/usr/bin/ld: skipping incompatible //usr/lib/libgdkmm-3.0.so when searching for -lgdkmm-3.0
/usr/bin/ld: cannot find -lgdkmm-3.0
collect2: error: ld returned 1 exit status

There are no files "lgtkmm-3.0" or "lgdkmm-3.0" on either my F30 or my F29 system (which has almost identical .pc files, just minor variations in version numbers). Nor can I locate such files on the Net.

Not sure where to head next... Thanks for any input.

vanntile
  • 2,727
  • 4
  • 26
  • 48
jonA
  • 31
  • 3
  • As it is a linker error, the following answer might be relevant (short form is: you might have an incompatible library of gtkmm) https://stackoverflow.com/a/3119774 – vanntile Jul 24 '20 at 16:46

0 Answers0