Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » gtkmm compilation error on eclipse(Errors caused during development and execution of gtkmm programs on eclipse.)
gtkmm compilation error on eclipse [message #1742134] Wed, 31 August 2016 16:08 Go to next message
Nikhil M Tomy is currently offline Nikhil M TomyFriend
Messages: 2
Registered: August 2016
Junior Member
I wrote(copied) a code (given below) and executed in MSYS2 mingw32 [on windows 7] and have successfully compiled by command line
g++ -o E:\\Programs\\MSYS2\\testapp E:\\Programs\\MSYS2\\f.cpp `pkg-config --cflags --libs gtkmm-3.0`


Now I tried to compile the same code in eclipse with some edits in the compiler setting for gtkmm like including 'MSYS2 mingw32 include' directory.

The editor does not show any errors on the code.

But when I compile I get the following errors.Please help



  • 21:28:46 **** Incremental Build of configuration Debug for project S ****
  • Info: Configuration "Debug" uses tool-chain "MinGW GCC" that is unsupported on this system, attempting to build anyway.
  • Info: Internal Builder is used for build
  • g++ "-IE:\\Programs\\MSYS2\\mingw32\\include\\glibmm-2.4" "-IE:\\Programs\\MSYS2\\mingw32\\include\\gtkmm-3.0" "-IE:\\Programs\\MSYS2\\mingw32\\lib\\gtkmm-3.0\\include" "-IE:\\Programs\\MSYS2\\mingw32\\include\\gdkmm-3.0" -O2 -g -Wall -c -fmessage-length=0 -o "Src\\main.o" "..\\Src\\main.cpp" `pkg-config --cflags gtkmm-3.0`
  • g++.exe: error: `pkg-config: No such file or directory
  • g++.exe: error: gtkmm-3.0`: No such file or directory
  • g++.exe: error: unrecognized command line option '--cflags'

  • 21:28:46 Build Finished (took 133ms)


SCREENSHOTS:
Code
index.php/fa/26944/0/

Compiler Flags
index.php/fa/26942/0/

Linker Flags
index.php/fa/26943/0/

Include Paths
index.php/fa/26941/0/
  • Attachment: s1.JPG
    (Size: 121.25KB, Downloaded 3086 times)
  • Attachment: s2.JPG
    (Size: 123.04KB, Downloaded 3249 times)
  • Attachment: s3.JPG
    (Size: 116.78KB, Downloaded 2990 times)
  • Attachment: s4.JPG
    (Size: 74.34KB, Downloaded 3181 times)
Re: gtkmm compilation error on eclipse [message #1742227 is a reply to message #1742134] Wed, 31 August 2016 22:18 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
The g++ command line is trying to run (before the actual g++ execution) `pkg-config --cflags gtkmm-3.0` which you apparently don't have. Or, if you do, then the back ticks, which mean "run this shell command", are not understood by the internal builder or the Windows command shell. You might try switching to the external builder but the shell you use would need to understand the back ticks. If you are able to execute the entire g++ command from a Windows command propmt then it likely is the internal builder as g++ is complaining not only about the pkg-config but also its parameters as if they were separate.

pkg-config reports various things about an installed package. It was originally developed for Linux but there are Windows versions available.
It requires that installation of a package will generate a configuration file.

Lacking that, what the command does (because of the -cflags) is return the includes paths needed to build using gtkmm plus other things like a reference to POSIX threads for GTK. There are a lot (this is for my Linux system):

-pthread -I/usr/include/gtkmm-3.0 -I/usr/lib64/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/lib64/gdkmm-3.0/include -I/usr/include/giomm-2.4 -I/usr/lib64/giomm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib64/pangomm-1.4/include -I/usr/include/glibmm-2.4 -I/usr/lib64/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/lib64/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/cairomm-1.0 -I/usr/lib64/cairomm-1.0/include -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include 


If you still want the internal builder, you could add the include paths to your project manually. The ones for your system, of course. If you actually can execute pkg-config then maybe you can cut and paste them.

There is also a corresponding argument for loader flags.


[Updated on: Wed, 31 August 2016 23:01]

Report message to a moderator

Re: gtkmm compilation error on eclipse [message #1742229 is a reply to message #1742227] Thu, 01 September 2016 02:59 Go to previous messageGo to next message
Nikhil M Tomy is currently offline Nikhil M TomyFriend
Messages: 2
Registered: August 2016
Junior Member
I could compile the code from mingw32.exe from the base folder of MSYS2. So I copied the result from the execution of `pkg-config --cflags gtkmm-3.0` and `pkg-config --libs gtkmm-3.0` (from MSYS2\mingw32.exe) to build variables named PKGCFLAGS and PKGLFLAGS respectively. Then I added ${PKGCFLAGS} to GCC C++ Compiler Command line pattern and ${PKGLFLAGS} to GCC C++ Linker Command line pattern.

When I tried to compile the previous error changed to the following

PREVIOUS error

  • 21:28:46 **** Incremental Build of configuration Debug for project S ****
  • Info: Configuration "Debug" uses tool-chain "MinGW GCC" that is unsupported on this system, attempting to build anyway.
  • Info: Internal Builder is used for build
  • g++ "-IE:\\Programs\\MSYS2\\mingw32\\include\\glibmm-2.4" "-IE:\\Programs\\MSYS2\\mingw32\\include\\gtkmm-3.0" "-IE:\\Programs\\MSYS2\\mingw32\\lib\\gtkmm-3.0\\include" "-IE:\\Programs\\MSYS2\\mingw32\\include\\gdkmm-3.0" -O2 -g -Wall -c -fmessage-length=0 -o "Src\\main.o" "..\\Src\\main.cpp" `pkg-config --cflags gtkmm-3.0`
  • g++.exe: error: `pkg-config: No such file or directory
  • g++.exe: error: gtkmm-3.0`: No such file or directory
  • g++.exe: error: unrecognized command line option '--cflags'

  • 21:28:46 Build Finished (took 133ms)


NEW Error


  • 08:15:54 **** Incremental Build of configuration Debug for project S ****
  • Info: Configuration "Debug" uses tool-chain "MinGW GCC" that is unsupported on this system, attempting to build anyway.
  • Info: Internal Builder is used for build
  • g++ "-IE:\\Programs\\MSYS2\\mingw32\\include\\glibmm-2.4" "-IE:\\Programs\\MSYS2\\mingw32\\include\\gtkmm-3.0" "-IE:\\Programs\\MSYS2\\mingw32\\lib\\gtkmm-3.0\\include" "-IE:\\Programs\\MSYS2\\mingw32\\include\\gdkmm-3.0" -O0 -g3 -Wall -c -fmessage-length=0 -o "Src\\main.o" "..\\Src\\main.cpp"
  • In file included from E:\Programs\MSYS2\mingw32\include\gtkmm-3.0/gtkmm.h:87:0,

  • E:\Programs\MSYS2\mingw32\include\glibmm-2.4/glibmm.h:83:26: fatal error: glibmmconfig.h: No such file or directory
  • #include <glibmmconfig.h>

  • compilation terminated.

  • 08:15:55 Build Finished (took 377ms)

Re: gtkmm compilation error on eclipse [message #1742308 is a reply to message #1742229] Thu, 01 September 2016 15:36 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Are you sure you added the variables to the compile pattern? They don't seem to be in the command or ${PKGCFLAGS} is null.

Temporarily change the compiler command to:
Command: echo
Pattern: ${COMMAND} FL=${FLAGS} O=${OUTPUT_FLAG} OP=${OUTPUT_PREFIX} OUTS=${OUTPUT} INPS=${INPUTS} PKGC=${PKGCFLAGS}

and see what you get for each variable in the pattern.

Previous Topic:Cannot determine GDB version
Next Topic:Newbie questions - remote debug and attach process debug
Goto Forum:
  


Current Time: Fri Mar 29 05:06:17 GMT 2024

Powered by FUDForum. Page generated in 0.04903 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top