【发布时间】:2014-03-08 19:05:32
【问题描述】:
我正在尝试编译我的第一个 FLTK 文件。首先我通过 gcc 使用 -lfltk 选项编译它,我得到了这个错误:
/usr/bin/ld: /tmp/ccX7sPxQ.o: undefined reference to symbol '__gxx_personality_v0@@CXXABI_1.3'
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
为什么我会收到此错误消息?如果我改用 g++,它只会编译它。
编辑。 fltk-config --cxxflags 返回:
-I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
-I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
-I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/libpng12 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
【问题讨论】:
-
提供
fltk-config [--<using>] --cflags / cxxflags / ldflags / compile的输出可能会有所帮助 - 另请参阅:man fltk-config。如果您不使用g++,您使用的是什么?clang?简而言之,您需要提供更多信息。
标签: gcc compilation fltk