ok. I will check that about wizard scripts and try to make a portable GTK template.
But i think that the problem wont be fixed by that.
At the gtk wizard.script is this:
if (PLATFORM == PLATFORM_MSW)
{
project.AddIncludeDir(GtkPathDefaultInc);
project.AddIncludeDir(GtkPathDefaultInc + wxFILE_SEP_PATH + _T("gtk-2.0"));
project.AddIncludeDir(GtkPathDefaultInc + wxFILE_SEP_PATH + _T("cairo"));
project.AddIncludeDir(GtkPathDefaultInc + wxFILE_SEP_PATH + _T("gdk"));
project.AddIncludeDir(GtkPathDefaultInc + wxFILE_SEP_PATH + _T("glib-2.0"));
// Notice GtkPathDefault*Lib* at some positions. This is correct as of 2.8.20
project.AddIncludeDir(GtkPathDefaultLib + wxFILE_SEP_PATH + _T("glib-2.0") + wxFILE_SEP_PATH + _T("include"));
project.AddIncludeDir(GtkPathDefaultInc + wxFILE_SEP_PATH + _T("pango-1.0"));
project.AddIncludeDir(GtkPathDefaultLib + wxFILE_SEP_PATH + _T("gtk-2.0") + wxFILE_SEP_PATH + _T("include"));
project.AddIncludeDir(GtkPathDefaultInc + wxFILE_SEP_PATH + _T("atk-1.0"));
project.AddLibDir(GtkPathDefaultLib);
// add link libraries
project.AddLinkLib(_T("gtk-win32-2.0"));
project.AddLinkLib(_T("gobject-2.0"));
project.AddLinkLib(_T("glib-2.0"));
// Notice: there are more libs required as the app gets more complex, e.g.:
// pangocairo-1.0.lib, pangocairo-1.0.lib, libatk-1.0.dll.a,
// gdk_pixbuf-2.0.lib, gdk-win32-2.0.lib, pango-1.0.lib,
// gmodule-2.0.lib, gthread-2.0.lib, cairo.lib,
// pangoft2-1.0.lib (...)
project.AddCompilerOption(_T("-mms-bitfields"));
}
else
{
/*if (GtkVersion == 1)
{*/
project.AddCompilerOption(_T("`pkg-config gtk+-2.0 --cflags`"));
project.AddLinkerOption(_T("`pkg-config gtk+-2.0 --libs`"));
/*}
else
{
project.AddCompilerOption(_T("`pkg-config gtk+ --cflags`"));
project.AddLinkerOption(_T("`pkg-config gtk+ --libs`"));
}*/
}
If you have programmed on linux you can see the special quotes used with pkg-config.
Thoose are not supported by windows so it wont work with a just system() or exec() call.
I have attached some screenshots to be more clear.
One shows my project setup, focused on the windows target and everything disabled. It shouldnt be. I should be able to change my own project options.
It also shows the pkg-config and others "--cflags" in an offtopic(?) place "Other options". Thoose lines should be somehow under the search Tab and be autoconfigured acordingly to the selected "Libraries used in the project" as shown in the other sshot.
This Libraries dialog should also be part of each target configuration, and not globals per project.
Windows may require sometimes different libs. Like if you use, libusb on linux and the windows USB-API. There are also differences on some export simbols used by glade to autoconnect signals.
The last images, shows error messages because the pkg-config call is not being executed, and the include and linker dirs are not found.
One can know where is pkg-config on windows. If you setup the GTK path then it is at $GTK/bin/pkg-config.exe
Then codeblocks should do what windows doesnt on parsing the special quotes `...`
What i am trying to say is that, i can make different targets for each OS an have a different configuration for each one, but this may be a work around to the better fix.
If the toolkit used is platform independent, ¿shouldnt it by default be configured the same on all platforms?
Also, it seems strange to configure a project on linux and CB, because all the normal lines are always on places like "Other Options" or "Other linker options" or "Other stuff", thoose places are always like "almost never used" or "use with acknowledge", and are not very obvius to the beginner.
I will post here my GTK template when i have it working because here is more handy to me.
[attachment deleted by admin]
works for me
goto project -> build options -> compiler settings -> other options add the text
`c:\gtk\bin\pkg-config gtk+-2.0 --cflags --errors-to-stdout`
You can see the compiler command lines and output after switching on full compiler logging in the compiler settings. In my case I get an error because PKG_CONFIG_PATH wasn't set
btw folks, it is a little worrying that if the back tick fails to execute C::B proceeds as if nothing is wrong. e.g. if pkg-config is missing wouldn't it be better to produce a compiler error, or at least a warning (maybe I've missed something)