Hello world程序在gtkmm中崩溃
Hello world program crashes in gtkmm
我正在尝试让gtkmm使用MinGW在Windows 7上运行。但是,当我从gtkmm教程中编译helloworld程序后,exe只会出现segfault。
我用这个编译了这个程序:
$ g++ helloworld.cc main.cc -o hw `pkg-config --cflags --libs gtkmm-2.4`
以下是gdb显示的内容:
$ 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.
我有点新手,所以我不知道如何让它发挥作用。
我已经从这里下载了gtkmm(2.22版本)和g++的版本:
$ g++ -v
Using built-in specs.
COLLECT_GCC=c:Mingwbing++.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)
我还需要什么吗?或者我只是做错了?
MinGW似乎在GCC 4.7.0中对ABI进行了更改。如果您的gtkmm是用早期的GCC编译的,这将导致您所看到的问题。尝试使用相同的编译器重建gtkmm。
相关文章:
- 当回溯以零开始时,如何调试崩溃
- 内联映射初始化的动态atexit析构函数崩溃
- 执行函数时导致崩溃的变量
- 程序崩溃并显示"std::out_of_range"错误
- Windows 10-使用gtkmm-3.0库和g++[包括再现]的分段故障
- CoInitialize()在单独的线程上崩溃而不返回
- 使用调试/崩溃报告将应用程序部署到客户端
- 为什么所有C++编译器都会崩溃或挂起此代码
- 为什么lambda在clang上崩溃而不是在gcc上崩溃
- 为什么我的多线程作业队列崩溃
- C++GTKMM gui循环依赖关系
- ExtractIconEx:可以工作,但偶尔会崩溃
- 为什么引用传递会导致此崩溃(C++)
- 试图创建流或fopen时程序崩溃
- 类对象数组的问题会导致崩溃
- 排序时无法执行交换操作.我做的时候它会崩溃.为什么
- Gtkmm应用程序在调整窗口大小时在Windows 8.1上崩溃
- Hello world程序在gtkmm中崩溃
- GTKmm:程序崩溃时,试图连接按钮点击信号
- Gtkmm程序编译良好,但崩溃- windows XP