Author Topic: setting up Code::Blocks to compile gtkmm 3.0 applicatons  (Read 79 times)

Offline darrylctx

  • Single posting newcomer
  • *
  • Posts: 2
I am new to code::blocks, and I'm having a problem getting it setup to compile gtkmm 3.0 apps.

I get the following build error.

I've added the line 'pkg-config --cflags gtk+-3.0' to the compiler other options, and the line 'pkg-config glibmm-3.0 --libs' to the linker setting other options.

The build output includes 'pkg-config --cflags gtk+-2.0' in the build command.  Where is this coming from?  Any hints as to why the build is failing.  I can compile the simple gtkmm 3.0 example using the command line:

g++ simple.cc -std=c++11 -o simple `pkg-config gtkmm-3.0 --cflags --libs`

Thanks in advance for any help.

-------------- Build: Debug in test1 (compiler: GNU GCC Compiler)---------------

g++ -Wall 'pkg-config --cflags gtk+-2.0' -g 'pkg-config --cflags gtk+-3.0' pkg-config gtkmm-3.0 --cflags  -c /home/pi/cpp/test1/test1/test1.cpp -o obj/Debug/test1.o
g++: fatal error: no input files
compilation terminated.
Process terminated with status 4 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6241
    • My Best Post
Re: setting up Code::Blocks to compile gtkmm 3.0 applicatons
« Reply #1 on: Yesterday at 04:34:51 pm »
Need to use "`" and not "'" single quote.
On my keyboard the "`" is the same key as "~".

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Miguel Gimenez

  • Multiple posting newcomer
  • *
  • Posts: 89
Re: setting up Code::Blocks to compile gtkmm 3.0 applicatons
« Reply #2 on: Yesterday at 04:36:08 pm »
You are using single quotes instead (')of backticks (`), so the commands are not executed. In the working command line there are backticks.

The reference to 2.0 can be in the general project options (you can have settings for the debug target and for the whole project, and with default settings the target options are appended to the poject options).

Offline darrylctx

  • Single posting newcomer
  • *
  • Posts: 2
Re: setting up Code::Blocks to compile gtkmm 3.0 applicatons
« Reply #3 on: Today at 01:27:11 am »
Thanks for the back tick catch.  I thought that I'd fixed that before, but I'm still getting the no input files error, and the 'pkg-config --cflags gtk+-2.0' is still in the g++ command.  See Build error below.


-------------- Build: Debug in test1 (compiler: GNU GCC Compiler)---------------

g++ -Wall 'pkg-config --cflags gtk+-2.0' -g -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include pkg-config gtkmm-3.0 --cflags  -c /home/pi/cpp/test1/test1/test1.cpp -o obj/Debug/test1.o
g++: fatal error: no input files
compilation terminated.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6241
    • My Best Post
Re: setting up Code::Blocks to compile gtkmm 3.0 applicatons
« Reply #4 on: Today at 02:24:32 am »
Sometimes you need to save and close the project when editing the options between `` .
Note: I close and reopen Code::Blocks because that always works for me. The closing projects and reopening that others reports as working normally fails for me.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org