Reputation: 21
I am trying to get gtkmm working on Windows 7 with MinGW. But, when after I compile the hello world program from the gtkmm-tutorial, the exe just crashes with a segfault.
I've compiled the program with this:
$ g++ helloworld.cc main.cc -o hw `pkg-config --cflags --libs gtkmm-2.4`
Here's what gdb shows:
$ gdb hw.exe
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from c:\dev/hw.exe...done.
(gdb) run
Starting program: c:\dev/hw.exe
[New Thread 4348.0x1560]
[New Thread 4348.0x1430]
Program received signal SIGSEGV, Segmentation fault.
0x664d85b2 in Glib::ObjectBase::ObjectBase (this=0x47453c, __vtt_parm=0x1,
__in_chrg=<value optimized out>) at objectbase.cc:49
49 objectbase.cc: No such file or directory.
I'm a bit newbie, so I don't know how to get it to work.
I've downloaded gtkmm from here (the 2.22 version) and the g++'s version:
$ g++ -v
Using built-in specs.
COLLECT_GCC=c:\Mingw\bin\g++.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/i686-pc-mingw32/4.7.1/lto-wrappe
r.exe
Target: i686-pc-mingw32
Configured with: ../src/configure --prefix=/c/temp/gcc/dest --with-gmp=/c/temp/g
cc/gmp --with-mpfr=/c/temp/gcc/mpfr --with-mpc=/c/temp/gcc/mpc --enable-language
s=c,c++ --with-arch=i686 --with-tune=generic --disable-libstdcxx-pch --disable-n
ls --disable-shared --disable-sjlj-exceptions --disable-win32-registry --enable-
checking=release --enable-lto
Thread model: win32
gcc version 4.7.1 (GCC)
Do I need something more? or I'm just doing it wrong?
Upvotes: 2
Views: 818
Reputation: 49019
It seems MinGW made an ABI change with GCC 4.7.0. If your gtkmm was compiled with an earlier GCC, this would cause problems like you are seeing. Try rebuilding gtkmm with the same compiler.
Upvotes: 2