Author Topic: include file <gtk/gtk.h> not found un ubuntu 14.04 while compiling Code::Blocks  (Read 7244 times)

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 176
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13438
    • Travis build status
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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7187
    • My Best Post
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

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.
« Last Edit: December 07, 2014, 05:39:43 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 176
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.

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 176
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.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
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

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7254
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.

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 176
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.

  • I created in my home-directory a folder path Tools/CodeBlocks/CB_10050
  • I used in the svn-root the command
     ./configure --with-contrib-plugins=all --prefix=/home/eckard/Tools/CodeBlocks/CB_10050
     (please reffer to: http://forums.codeblocks.org/index.php/topic,18421.msg125990.html#msg125990
     and note that I already run ./bootstrap in my trials before.)
  • Then I  run  make
  • And finaly I run sudo make install
What should I say this was the last part of the puzzle, since this seems to work. Thank you very much.