I use the following command on Eclipse Helios on Windows 7 x64 with MinGW/MSys with no problems.
    g++ -m64  `wx-config --cxxflags`

One thing that comes to mind is whether Eclipse is using the Windows MinGW binaries from the command prompt or is it using the MSys binaries? Perhaps Eclipse has defaulted to the Windows binaries and the DOS comman prompt.

Are you using a makefile project? If so, what sort of makefile project are you using? I use a Linux makefile project under Windows, if you a different style of makefile project (MinGW for example) that may be telling Eclipse to use the Windows binaries instead of the MSys ones.


On 25/01/11 10:05, Andrew Hurrell wrote:

Dear List readers


I’ve spent many hours searching both these mailing lists and more generally on the web to try and resolve the problem below.  Apologies in advance if this has already been solved but I haven’t encountered a working solution yet.  I’m also aware that this may be more of an Eclipse issue than Mingw, but am hoping that the group may have encountered a solution.  FYI I’m using

Windows XP Pro (but similar problems on a Win 7 system)

Eclipse Indigo M4

GTK+ 2.22.0

Mingw 20101030


I have a fully working Mingw/Msys setup and am able to compile GTK+ applications from the command line within MSys using pkg-config

(i.e. gcc `pkg-config –cflags gtk+2.0 libglade2.0` foo.c ` pkg-config –libs gtk+2.0 libglade2.0`)


Previously I have only be able to use Eclipse to compile GTK+ apps with Mingw by cut/paste all cflags and libs output produced by pkg-config into the relevant compiler build settings on Eclipse.  Given that I have many different apps and libraries, many of which use GTK+ this is painful in the extreme


What I’d like to be able to do is to add the `pkg-config <blah>` commands to Properties->C/C++ Build->Settings->Tool Settings within Eclipse.  However all attempts to build result in

gcc -Iworkspace\include -O0 -g3 -Wall -c -fmessage-length=0 -mwindows `pkg-config --cflags gtk+-2.0 libglade-2.0` -o ext_trig.o ..\ext_trig.c

cc1.exe: error: unrecognized command line option "-fcflags"

gcc: `pkg-config: No such file or directory

gcc: gtk+-2.0: No such file or directory

gcc: libglade-2.0`: No such file or directory

Build error occurred, build is stopped

Time consumed: 344  ms. 


I’m assuming that this is because Eclipse is using the standard windows shell and is thus unable to interpret the back-tick syntax.  Do any of the users on this group know how to encourage Eclipse to co-operate with MSys shell and thereby get the pkg-config command to play nicely?


Many thanks in advance for your assistance