Hi, I installed gtk 3.0 dev (using apt-get install), libwxgtk (using synaptic) and codeblocks (using apt-get). I'm getting error for my gtk project:
Quotefatal error: gtk/gtk.h: no such file or directory
Here's a screenshot: (https://i.hizliresim.com/PrOgA9.png)
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)
Is the GTK devel package installed?
Edit: After installing GTK devel package, did you exit out of Code::Blocks and reenter CB and try rebuilding.
Tim S.
Thanks for the quick reply. No I don't think so. I just tried
sudo apt-get install gtk-develbut I got error:
QuoteE: Unable to locate package gtk-devel
I installed codeblock after installing gtk. Anyway I tried dpkg-reconfigure codeblocks if you mean that, it still doesn't work. And searched a lot for rebuilding codeblocks however couldn't find anything useful. How can I rebuild CB?
POST A BUILD LOG!
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
Build -> Rebuild is how to rebuild a project.
Please try to follow the links I posted or I will have to just ignore you.
Tim S.
I rebuilded the project and here's its build log:
Quote-------------- Clean: Debug in testproject01 (compiler: GNU GCC Compiler)---------------
Cleaned "testproject01 - Debug"
-------------- Build: Debug in testproject01 (compiler: GNU GCC Compiler)---------------
gcc -Wall -g -c /home/nikel/Desktop/testproject01/testproject01/main.c -o obj/Debug/main.o
/home/nikel/Desktop/testproject01/testproject01/main.c:2:21: fatal error: gtk/gtk.h: No such file or directory
#include <gtk/gtk.h>
^
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Have you created the project via the gtk project wizard from codeblocks, or did you created a c++ project?
I created it via gtk project wizard. I'm trying to build c project.
c - How to install gtk development dependencies on Ubuntu? - Stack Overflow - https://stackoverflow.com/questions/15390181/how-to-install-gtk-development-dependencies-on-ubuntu This link may help you.
If you use a wizard-created project, please check the compiler and linker settings:
"Build options -> [your project] -> Compiler settings -> Other compiler settings" and
"Build options -> [your project] -> Linker settings -> Other linker options".
Both will refer to gtk+2.0 pkg-config files, but Debian based distros (most others nowadays also) use gtk3 as default.
So you have to fix these entries to point to the correct gtk-devel files.
It should be enough to change the "2" to a "3".
You can check it on a console.
You might need to close and reopen C::B to make this be recognized.
Quote from: nikel on July 11, 2017, 05:59:49 PM
Thanks for the quick reply. No I don't think so. I just tried
sudo apt-get install gtk-devel
but I got error:
QuoteE: Unable to locate package gtk-devel
And the package is called "libgtk-3-dev" or "libgtk2.0-dev" if you want gtk2.