Gtk cannot find "<config.h>"
I find many examples of using various gtk on the net, but most of them contain the included header
#include <config.h> and I cannot nicotate this header anywhere, so I cannot get these examples to work.
What it is? Where can I get it or with what can I replace this header?
Or can I configure such files / projects in different ways to make them work, since another gtk project is working on my computer?
I am currently trying to compile the example socket testsocket.c and at compile time I get an undefined link error to 'create_child_plug'. I see no reason why this does not work other than this header.
But Iām wrong anyway.
I think you are trying to compile one source file yourself, which was not intended to work independently. Two reasons.
First reason: config.h is the default name for the header file created by Autoconf, which contains platform definitions. Therefore, you will not find it anywhere - it is generated when you run ./configure in your project, and its contents depend on the configuration of your system. Thus, it will not be included in any project, you must generate it yourself using Autoconf. Or just comment out #include <config.h> and see what definitions are missing, then define them yourself.
Another reason:
I am currently trying to compile an example socket testsocket.c and at compile time I get an undefined error message to 'create_child_plug'. I see no reason for this not to work, except in this heading. But Iām wrong anyway.
Actually, this file contains the definition of create_child_plug :
extern guint32 create_child_plug (guint32 xid, gboolean local); So the problem is not that create_child_plug not defined. You do not need a header, it is defined directly in the source file. extern means that the actual code for this function is in a different source file. In this case, you get a connection time error (not compile time), because the linker cannot find the code for this function. You should look for it in the .c file, not the .h file, and compile this code too.
I suggest you download the entire GTK source code and compile it, and then run the test programs instead of selecting individual source files from the network.
In fact, the config.h header in the GTK + directory is missing. However, I have seen many people with problems similar to yours in forums, etc. What you are probably looking for is one of the following:
- fontconfig.h
- glibconfig.h
- gdkconfig.h
- ftconfig.h
They are located in:
include/fontconfig/lib/glib-2.0/includelib/gdk-2.0/includeinclude/freetype2/freetype/config
Also, are you sure you have added all the necessary directories so that your compilers include the path? On ubuntu its pretty easy with just pkg-config gtk+-2.0 .