I've started to learn gtkmm programming, but am stuck at the first step. I'm using GNOME builder IDE and Ubuntu 17.10 64bit.
Gnome has a nice tutorial for gtkmm, but building the code returns an error in builder!
Problem:
According to the tutorial, the source code must be compiled by g++, while builder uses gcc, since the file name is main.c
.
mohammad@Artful-K43SD:~/Projects/test/src$ g++ main.c -o simple `pkg-config gtkmm-3.0 --cflags --libs` -no-pie
mohammad@Artful-K43SD:~/Projects/test/src$ gcc main.c -o simple `pkg-config gtkmm-3.0 --cflags --libs` -no-pie
In file included from /usr/include/glibmm-2.4/glibmm/ustring.h:21:0,
from /usr/include/glibmm-2.4/glibmm/exception.h:22,
from /usr/include/glibmm-2.4/glibmm/error.h:22,
from /usr/include/glibmm-2.4/glibmm/thread.h:47,
from /usr/include/glibmm-2.4/glibmm.h:88,
from /usr/include/gtkmm-3.0/gtkmm.h:87,
from main.c:1:
/usr/include/glibmm-2.4/glibmm/unicode.h:26:10: fatal error: cctype: No such file or directory
#include <cctype>
^~~~~~~~
compilation terminated.
make V=0 -j4 all
make all-recursive
make[1]: Entering directory '/home/mohammad/.cache/gnome-builder/builds/test/default-local-host'
Making all in data
make[2]: Entering directory '/home/mohammad/.cache/gnome-builder/builds/test/default-local-host/data'
make[2]: Leaving directory '/home/mohammad/.cache/gnome-builder/builds/test/default-local-host/data'
Making all in src
make[2]: Entering directory '/home/mohammad/.cache/gnome-builder/builds/test/default-local-host/src'
CC test-main.o
In file included from /usr/include/glibmm-2.4/glibmm/ustring.h:21:0,
from /usr/include/glibmm-2.4/glibmm/exception.h:22,
from /usr/include/glibmm-2.4/glibmm/error.h:22,
from /usr/include/glibmm-2.4/glibmm/thread.h:47,
from /usr/include/glibmm-2.4/glibmm.h:88,
from /usr/include/gtkmm-3.0/gtkmm.h:87,
from /home/mohammad/Projects/test/src/main.c:1:
/usr/include/glibmm-2.4/glibmm/unicode.h:26:10: fatal error: cctype: No such file or directory
#include <cctype>
^~~~~~~~
compilation terminated.
make[2]: *** [test-main.o] Error 1
Makefile:481: recipe for target 'test-main.o' failed
make[1]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/mohammad/.cache/gnome-builder/builds/test/default-local-host/src'
make: *** [all] Error 2
Makefile:477: recipe for target 'all-recursive' failed
make[1]: Leaving directory '/home/mohammad/.cache/gnome-builder/builds/test/default-local-host'
Makefile:409: recipe for target 'all' failed
I just want to tell autotools to use g++ for .c
files instead of gcc. tried edit the configure.ac
file in the project folder, but I wasn't successful! The makefile is generated by builder and if I add a .cpp
file to project, the makefile won't update!
Is it possible to code gtkmm in builder?
0 Answers