I want to create a custom GTK module that must be loaded when the GTK application starts.
Documentation on this topic is rare, I searched a lot, but I could not start it. I am on Ubuntu Linux with GTK3 and tried sofar:
- Compiled and linked to a shared library with a method
void gtk_module_init(gint *argc, gchar ***argv[])inside. As I understand it, this should be enough to create a simple module. Full code:
#include <iostream>
#include <gtk/gtk.h>
void gtk_module_init(gint *argc, gchar ***argv[]) {
std::cout << "huhu" << std::endl;
}
- Put this library in / usr / lib / x 86_64-linux-gnu / gtk-3.0 / modules / libtest-gtk-module.so
- I tried to run the application as follows:
gnomine --gtk-module=libtest-gtk-module.soBut all I get is:Gtk-Message: Failed to load module "libtest-gtk-module.so"
So what else needs to be done to get GTK to load this library?
Thank you very much in advance!
Simme source
share