免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1961 | 回复: 6
打印 上一主题 下一主题

[C++] C++的这个编译错误怎么处理? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-09-07 11:04 |只看该作者 |倒序浏览
/greatwall/Trunk/CM/../CLI/CliPrint.cpp:16: undefined reference to `__builtin_new'
/greatwall/Trunk/CM/../CLI/CliPrint.cpp:16: undefined reference to `__builtin_delete'
/greatwall/Trunk/CM/../CLI/CliPrint.cpp:17: undefined reference to `__builtin_delete'
/greatwall/Trunk/CM/../CLI/CliPrint.cpp:17: undefined reference to `__rethrow'
../CLI/CliPrint.o: In function `CliPrint::~CliPrint(void)':
/greatwall/Trunk/CM/../CLI/CliPrint.cpp:89: undefined reference to `__builtin_delete'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__builtin_vec_delete'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__rtti_user'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__cp_push_exception'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `int type_info function'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__rtti_attr'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__throw'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__cp_pop_exception'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `char type_info function'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__builtin_vec_new'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__start_cp_handler'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__rtti_si'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__uncatch_exception'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__rtti_class'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `terminate(void)'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `char type_info node'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__terminate'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__eh_alloc'
/usr/lib/libxerces-c1_6_0.so: undefined reference to `__rtti_ptr'
collect2: error: ld returned 1 exit status
make: *** [cm] Error 1

感觉是libxerces-c1_6_0.so 没有包含相应的库文件啊。咋办?谢谢高手指点

论坛徽章:
7
2015年亚洲杯之约旦
日期:2015-03-05 17:03:522015亚冠之山东鲁能
日期:2015-09-29 13:01:2115-16赛季CBA联赛之四川
日期:2016-01-18 15:47:0215-16赛季CBA联赛之广夏
日期:2016-02-24 11:47:1515-16赛季CBA联赛之辽宁
日期:2016-11-01 09:45:4115-16赛季CBA联赛之青岛
日期:2017-02-15 10:02:182016科比退役纪念章
日期:2017-02-16 17:25:35
2 [报告]
发表于 2012-09-07 11:32 |只看该作者
可以试试缺啥文件填啥文件,其实我觉着可能是下载的库文件不全,可以重新下载完整的包再试一次。

论坛徽章:
0
3 [报告]
发表于 2012-09-07 11:36 |只看该作者
libstdc++呢。

论坛徽章:
0
4 [报告]
发表于 2012-09-07 12:06 |只看该作者
可以嘗試到目錄/etc/ld.so.conf.d下建一個動態庫指向文件

论坛徽章:
4
天秤座
日期:2013-10-18 13:58:33金牛座
日期:2013-11-28 16:17:01辰龙
日期:2014-01-14 09:54:32戌狗
日期:2014-01-24 09:23:27
5 [报告]
发表于 2012-09-07 12:58 |只看该作者
楼主这是在编译GFW的代码么?

论坛徽章:
0
6 [报告]
发表于 2012-09-07 14:22 |只看该作者
本帖最后由 krocp 于 2012-09-07 14:47 编辑

LD=g++
LD_TEST=g++ -g
CPPFLAGS=-g -Wall -D_CM_ -I../ -I../XML/include/ -I. -I./include -I$(STANDARD_INC) -I$(KERNEL)/include -I$(KERNEL)/include/GWall -I$(MODULEDIR) -I../CLI/ -include /usr/include/errno.h -lstdc++ -lstdc -lnsl

加了红色字体三项也不行啊。
/usr/lib/libxerces-c1_6_0.so 是我直接拷的老的so。
是老的代码,2.4移到3.4内核。编译环境的问题?交叉编译?真心不懂。


[root@fedora bin]# gcc -v
Using built-in specs.
COLLECT_GCC=/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.7.0/lto-wrapper
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC)

论坛徽章:
0
7 [报告]
发表于 2012-09-07 15:40 |只看该作者
在makefile中加入:-lxerces-c1_6_0
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP