User forums > Using Code::Blocks

setting up Code::Blocks to compile gtkmm 3.0 applicatons

(1/2) > >>

darrylctx:
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))
 

stahta01:
Need to use "`" and not "'" single quote.
On my keyboard the "`" is the same key as "~".

Tim S.

Miguel Gimenez:
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).

darrylctx:
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.

stahta01:
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.

Navigation

[0] Message Index

[#] Next page

Go to full version