我正在尝试使用FreeBSD 10.x上的g ++ 49编译应用程序。
这是我的最小测试失败案例:
#include <iostream>
int main(int argc, char *argv[])
{
return 0;
}
用
编译g++49 foobar.cpp -lIrrlicht -g -o foobar
两者都没有与Irrlicht链接,或者删除#include都会停止崩溃。
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x0000000800f030e5 in __cxxabiv1::__dynamic_cast (
src_ptr=0x8011bc4c0 <(anonymous namespace)::ctype_c>,
src_type=0x8011a05d0 <typeinfo for std::locale::facet>,
dst_type=0x8011a0340 <typeinfo for std::ctype<char>>, src2dst=0)
at ../../.././../gcc-4.9-20150107/libstdc++-v3/libsupc++/dyncast.cc:60
#2 0x0000000800f35230 in std::has_facet<std::ctype<char> > (__loc=...)
at /wrkdirs/usr/ports/lang/gcc49/work/build/x86_64-portbld-freebsd10.0/libstdc++-v3/include/bits/locale_classes.tcc:110
#3 0x0000000800f299d4 in std::basic_ios<char, std::char_traits<char> >::_M_cache_locale
(this=this@entry=0x8011bb0c8 <std::cout+8>, __loc=...)
at /wrkdirs/usr/ports/lang/gcc49/work/build/x86_64-portbld-freebsd10.0/libstdc++-v3/include/bits/basic_ios.tcc:159
#4 0x0000000800f29b50 in std::basic_ios<char, std::char_traits<char> >::init (
this=this@entry=0x8011bb0c8 <std::cout+8>, __sb=
0x8011ba8c0 <__gnu_internal::buf_cout_sync>)
at /wrkdirs/usr/ports/lang/gcc49/work/build/x86_64-portbld-freebsd10.0/libstdc++-v3/include/bits/basic_ios.tcc:132
#5 0x0000000800f1bae1 in basic_ostream (__sb=<optimized out>, this=<optimized out>,
__in_chrg=<optimized out>, __vtt_parm=<optimized out>)
at /wrkdirs/usr/ports/lang/gcc49/work/build/x86_64-portbld-freebsd10.0/libstdc++-v3/include/ostream:85
#6 std::ios_base::Init::Init (this=<optimized out>)
at ../../../.././../gcc-4.9-20150107/libstdc++-v3/src/c++98/ios_init.cc:91
#7 0x00000000004009cf in __static_initialization_and_destruction_0 (__initialize_p=1,
__priority=65535) at /usr/local/lib/gcc49/include/c++/iostream:74
#8 0x00000000004009f8 in _GLOBAL__sub_I_main () at foobar.cpp:6
#9 0x00000008006047a0 in ?? () from /libexec/ld-elf.so.1
#10 0x0000000800603d17 in ?? () from /libexec/ld-elf.so.1
#11 0x0000000800602129 in ?? () from /libexec/ld-elf.so.1
#12 0x0000000000000000 in ?? ()
这是ldd:
的输出% ldd foobar
foobar:
libIrrlicht.so.1 => /usr/local/lib/libIrrlicht.so.1 (0x80081d000)
libstdc++.so.6 => /usr/local/lib/gcc49/libstdc++.so.6 (0x800ea6000)
libm.so.5 => /lib/libm.so.5 (0x8011bd000)
libgcc_s.so.1 => /usr/local/lib/gcc49/libgcc_s.so.1 (0x8013e5000)
libc.so.7 => /lib/libc.so.7 (0x8015fb000)
libGL.so.1 => /usr/local/lib/libGL.so.1 (0x8019a4000)
libXxf86vm.so.1 => /usr/local/lib/libXxf86vm.so.1 (0x801ccf000)
libX11.so.6 => /usr/local/lib/libX11.so.6 (0x801ed3000)
libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x802206000)
libjpeg.so.8 => /usr/local/lib/libjpeg.so.8 (0x80243e000)
libbz2.so.4 => /usr/lib/libbz2.so.4 (0x802679000)
libz.so.6 => /lib/libz.so.6 (0x80288b000)
libc++.so.1 => /usr/lib/libc++.so.1 (0x802aa1000)
libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x802d61000)
libnvidia-tls.so.1 => /usr/local/lib/libnvidia-tls.so.1 (0x802f7d000)
libnvidia-glcore.so.1 => /usr/local/lib/libnvidia-glcore.so.1 (0x80317e000)
libXext.so.6 => /usr/local/lib/libXext.so.6 (0x805bec000)
libxcb.so.1 => /usr/local/lib/libxcb.so.1 (0x805dfd000)
librpcsvc.so.5 => /usr/lib/librpcsvc.so.5 (0x80601b000)
libXau.so.6 => /usr/local/lib/libXau.so.6 (0x806224000)
libpthread-stubs.so.0 => /usr/local/lib/libpthread-stubs.so.0 (0x806426000)
libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x806627000)