Code::Blocks Forums

User forums => Help => Topic started by: eckard_klotz on December 07, 2014, 02:56:16 pm

Title: include file <gtk/gtk.h> not found un ubuntu 14.04 while compiling Code::Blocks
Post by: eckard_klotz on December 07, 2014, 02:56:16 pm
Hello everybody.

Currently I try to update my Code::Blocks installation on my Ubuntu 14.04 with the current svn content. Thus I transferred my fresh synchronized svn trunk folder to my Ubuntu computer and loaded the C::B workspace "CodeBlocks-unix.workspace" in the existing C::B release 13.12 to build the binaries of the whole workspace like I know it under Windows.

Now I get an error that tells me that the header gtk/gtk.h will not be found while building the target src of the project Code::Blocks wx2.8.x - Unix. Clicking on the error-message shows me that the associated include expects a  header known by the compiler since it is set in <> and not in "". I already checked if a gtk installation is available like told in the wiki and I found under "user/lib" the file "libgtk-x11-2.0.so.0" and "libgtk-x11-2.0.so.0.2400.23". But in the folder "user/include" there is no sub-folder gtk therefore in the folder "user/include/wx-28.1/wx" I can see one sub-folder gtk but without a file gtk.h.

Do I have to install an extra gtk package? Or do I have to adjust an additional search path for the compiler?

Best regards,
                      Eckard.
Title: Re: include file <gtk/gtk.h> not found un ubuntu 14.04 while compiling Code::Blocks
Post by: oBFusCATed on December 07, 2014, 05:31:55 pm
Yes, you need the dev or devel packaged.

If you're not going to develop cb, it is better to make yourself binary packaged using some debian command.
Title: Re: include file <gtk/gtk.h> not found un ubuntu 14.04 while compiling Code::Blocks
Post by: stahta01 on December 07, 2014, 05:34:33 pm
Do you have the GTK dev files installed? (Guess of a Windows Programmer).
Note: You likely will also need the wxGTK dev files installed as told in the Wiki link below.

http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks#Ubuntu (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks#Ubuntu)

Edit: I echo the suggestion from oBFusCATed if you are not going to develop changes to CB I suggest trying to install a binary installation instead of building it yourself. Note: if you plan to use wxGTK version of wxWidgets in your programming I would still suggest building CB yourself; but, if NOT I see no reason not to try the faster Binary Build of a CB release or Nightly.

Tim S.
Title: Re: include file <gtk/gtk.h> not found un ubuntu 14.04 while compiling Code::Blocks
Post by: eckard_klotz on December 07, 2014, 07:11:53 pm
Hello oBFusCATed and stahta01.

Thanks for your reply.

The reason why I was asking how to build was more for interest. May be you remember that we discussed some weeks ago my proposal to extend the symbol-browser with something like virtual folders and since I'm already able to build C::B on windows I thought it would be a good idea to learn how to do it on Ubuntu also.

Furthermore for my Moritz project I'm currently developing a GUI wizard that's using on Windows the same wxWidgets DLL you use. Thus I assume I will have the same problem there once I want to compile it for linux.

How ever, thanks for the link to the wiki. More or less I'm was able to manage the preparing work like installing the tools and libwxgtk. i hope I was also able to add the debian-project of jens to my apt-source-list (I was not able to add it directly to the list since some access-right problems).

But now my question is what to insert as file-name for "Name_Of_Daily_Build" in: sudo dpkg -i <Name_Of_Daily_Build.deb>

Can you give me an example or tip where to find it ?

Thanks,
             Eckard.
Title: Re: include file <gtk/gtk.h> not found un ubuntu 14.04 while compiling Code::Blocks
Post by: eckard_klotz on December 09, 2014, 12:50:30 pm
Hello Developers.

After finding the page"http://forums.codeblocks.org/index.php/topic,18421.msg125990.html#msg125990"
I was able to solve my gtk problem just by using the "sudo apt-get install xyz" command while xyz was the gtk library mentioned by the configure command. But I'm only able to run ./configure without parameters with success what means after it I was able to run make and sudo make install.

Now I have on my Ubuntu a Code::Blocks with the revision number 10050 but some plugins are not available for example the spell checking but it was available in the official release. Furthermore I'm not able to adjust the compiler-flags (right-click is also not working).

I assume that some other libraries are still not installed. If I run ./configure with the parameter set given by dmoore I get the error
Quote
Package requirements (hunspell) were not met:

No package 'hunspell' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix

Alternatively, you may set the environment variables HUNSPELL_CFLAGS and HUNSPELL_LIBS to avoid the need to call pkg-config.
see the pkg-config man-page for more details.
 


I tried the command "sudo apt-get install hunspell" in the hope to get a standard installation but than I get the information that hunspell is already installed in the newest version. So what version do I have to install or how do I have to set the environment-variables mentioned above ?

Thanks,
             Eckard.
Title: Re: include file <gtk/gtk.h> not found un ubuntu 14.04 while compiling Code::Blocks
Post by: Alpha on December 09, 2014, 03:39:00 pm
I tried the command "sudo apt-get install hunspell" in the hope to get a standard installation but than I get the information that hunspell is already installed in the newest version. So what version do I have to install or how do I have to set the environment-variables mentioned above ?
When building a program, in general it is the lib*-dev packages that need to be installed, so try:
sudo apt-get install libhunspell-dev
Title: Re: include file <gtk/gtk.h> not found un ubuntu 14.04 while compiling Code::Blocks
Post by: Jenna on December 09, 2014, 03:55:24 pm
To build  all contrib-plugins you need to run the configure-script with te "--with-contrib-plugins=all" paramater.
It should throw an error if a needed package is not installed, but it will not tell you the Ubuntu/Debian name of the package, just the missing development-lib/-header.
In general I suggest to run the configure script from within a seperate build-folder and call it from there with the relative path.
And building C::B (or other programs) into a separate folder below your home-folder is also a good idea (--prefix=/the/folder/you/want/to/use)and run C::B from the bin-folder inside it.
It's easier to remove such packages/build-folders to work with an absolute clean version (just remove the whole folder), because "make uninstall" is not reliable, if the library or folder-layout has changed.
Title: Re: include file <gtk/gtk.h> not found un ubuntu 14.04 while compiling Code::Blocks
Post by: eckard_klotz on December 09, 2014, 06:14:02 pm
Hello again.

Now it seem that I was able to install all necessary libraries over the software-center. Before I was not able to us it for since no library was listed and only the waiting symbol was displayed. But after clicking in the status-bar on message to show all 3844 technical libraries suddenly all libraries where shown. Now I was able to search for fitting libraries in the list instead of guessing their names as parameter for the terminal command. At the end I had to install 3 or 4 of them until the ./configure was working without complaining.

The commands make and make install seem to work without problems also. But number of plug-ins has not increased compared to the current nightly in windows I would assume that only 20% are available. It seems that not all plug-ins will be copied to "/usr/local/lib/codeblocks/plugins" only 13.

In the meanwhile I'm able to run the build of Code::Blocks with Code::Blocks but the command ./update is failing since the permission will be denied. It seems that I'm able to build project for project instead of building the whole workspace in one step (or I have to disable calling ./update). The result seems to be that the plug-ins will be build in the svn-folder "TRUNK/src/devel/share/codeblocks/plugins" (libXYZ.so) and the associated zip-files will be placed one level above. But this is not really helpful since once i copy them in the associated folders under /usr/local/........ they will be found but not loaded since there are SDK incompatibilities. 

OK as result of today I can build Codeblocks in the terminal as described here: http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux
I see no error-messages but it may be that this is only a result of the fact that they are shifted out of the screen before I see them since the build log is to huge. On the other side in all cases before the process stopped at the first error while now at the end of the process no error is displayed. Thus I think that the build of the binaries and zip-files worked as desired but not all results are shifted into the destination folders. How can I check this? Where are the build-results placed before copying them to "usr/local" ?

Best regards,
                      Eckard.
     
PS.: Hello Alpha and Jens. I wrote this comment while you wrote yours and this while testing parts of it.
Alpha, I think the missing libraries are installed now, thanks.
Jens, you suggest to build the program in under my home. I absolutely agree, since I do it the same way if I install programs at windows.

What should I say this was the last part of the puzzle, since this seems to work. Thank you very much.