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

Offline darrylctx

  • Single posting newcomer
  • *
  • Posts: 4
setting up Code::Blocks to compile gtkmm 3.0 applicatons
« on: July 16, 2018, 03:56:44 pm »
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: 7582
    • My Best Post
Re: setting up Code::Blocks to compile gtkmm 3.0 applicatons
« Reply #1 on: July 16, 2018, 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 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: setting up Code::Blocks to compile gtkmm 3.0 applicatons
« Reply #2 on: July 16, 2018, 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: 4
Re: setting up Code::Blocks to compile gtkmm 3.0 applicatons
« Reply #3 on: July 17, 2018, 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: 7582
    • My Best Post
Re: setting up Code::Blocks to compile gtkmm 3.0 applicatons
« Reply #4 on: July 17, 2018, 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 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline darrylctx

  • Single posting newcomer
  • *
  • Posts: 4
Re: setting up Code::Blocks to compile gtkmm 3.0 applicatons
« Reply #5 on: July 17, 2018, 08:59:49 pm »
Tim,

Thanks for the help.  Restarting code blocks fixed the gtkmm 2.0 reference.  Damn linux.....you never have to restart it, so you get used to not going through the whole reboot, restart routine every time you have a problem ;-). 

I am still getting the no input files error.  See below.

g++ -Wall 'pkg-config --cflags gtk+-3.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 -pthread -I/usr/include/gtkmm-3.0 -I/usr/lib/arm-linux-gnueabihf/gtkmm-3.0/include -I/usr/include/atkmm-1.6 -I/usr/include/gtk-3.0/unix-print -I/usr/include/gdkmm-3.0 -I/usr/lib/arm-linux-gnueabihf/gdkmm-3.0/include -I/usr/include/giomm-2.4 -I/usr/lib/arm-linux-gnueabihf/giomm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib/arm-linux-gnueabihf/pangomm-1.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/arm-linux-gnueabihf/glibmm-2.4/include -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/sigc++-2.0 -I/usr/lib/arm-linux-gnueabihf/sigc++-2.0/include -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 -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include  -c /home/pi/cpp/test1/test1/test1.cpp -o obj/Debug/test1.o
g++: fatal error: no input files
compilation terminated.

Offline darrylctx

  • Single posting newcomer
  • *
  • Posts: 4
Re: setting up Code::Blocks to compile gtkmm 3.0 applicatons
« Reply #6 on: July 17, 2018, 09:31:22 pm »
As I expected, it was a silly error.   The compiler is looking for .cc files.....I had called it .cpp.

Thanks for the help.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: setting up Code::Blocks to compile gtkmm 3.0 applicatons
« Reply #7 on: July 17, 2018, 09:48:19 pm »
Quote
Thanks for the help.  Restarting code blocks fixed the gtkmm 2.0 reference.  Damn linux.....you never have to restart it,
i think this is a codeblocks issue... As soon as you alter the build settings (or even only hit OK in the build settings) it should do the caching.... Not only after restarting codeblocks...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: setting up Code::Blocks to compile gtkmm 3.0 applicatons
« Reply #8 on: July 18, 2018, 01:49:46 am »
Quote
Thanks for the help.  Restarting code blocks fixed the gtkmm 2.0 reference.  Damn linux.....you never have to restart it,
i think this is a codeblocks issue... As soon as you alter the build settings (or even only hit OK in the build settings) it should do the caching.... Not only after restarting codeblocks...

I seem to be the only one that has this problem most of the time; but, I am on Windows OS.
The people on Linux seem to have good luck closing the project and reopening it.
I think what we need is a project reload feature that fixes the issue on both Linux and Windows.
An clear project cache option would also likely be a good work around.

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org