How to setup GTK+ to develop with Code::Blocks on Ubuntu Linux

前端 未结 1 815
别跟我提以往
别跟我提以往 2020-12-15 01:28

I am trying to develop a GTK+ application on Ubuntu 11.4, using Code::Blocks.

www.gtk.org has instructions on building GTK+ from source, that looked complicated. But

相关标签:
1条回答
  • 2020-12-15 02:18

    Assuming that you have located and installed the correct package. As of 2011, the current package was libgtk-3-dev then the pkg-config tool can be used to extract the linker and compiler flags - and with proper escaping in the Code:Blocks settings can inject the correct settings automatically.

    Open Code::Blocks Settings > Compiler and Linker Settings... and add the following under Global Compiler Settings > Compiler Settings > Other Options

    `pkg-config --cflags gtk+-3.0`
    

    and add this to Global Compiler Settings > Linker Settings > Other Options

    `pkg-config --libs gtk+-3.0`
    

    With the ` this has the effect of running the pkg-config tool calling --cflags gtk+-3.0 (or --libs) which, assuming libgtk3-dev is installed, injects the necessary search folders and lib directives onto the gcc command line.


    As an alternative, developer.ubuntu.com lists Anjuta as a C/C++ IDE that can create GTK+ projects. As an alternative to Code::Blocks its far more polished as an Ubuntu IDE.


    Scratch that. Anjuta looses its sheen quickly.

    0 讨论(0)
提交回复
热议问题