使用 cmake 实用程序编译时出错

error in compiling using cmake utility

本文关键字:出错 编译 实用程序 cmake 使用      更新时间:2023-10-16

我正在尝试使用以下 make 命令编译我的 gcc 代码。操作系统:红帽,gcc - 4.1
但是我收到如下错误:rmtrain@lintrni130 $/usr/local/bin/make all

[ 21%] Built target GCVCore
Linking CXX executable CFE
/usr/bin/ld: warning: libicui18n.so.36, needed by ../../Generic/icu/lib/libicuio.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libxalanMsg.so.110, needed by ../../Generic/Xalan/lib/libxalan-c.so, not found (try using -rpath or -rpath-link)
CMakeFiles/CFE.dir/trnuser1/rmtrain/DevelopmentEnv/Generic/ConvUI/GCVConvUISetting.o: In function `xercesc_2_6::XMLAttDefList::~XMLAttDefList()':
GCVConvUISetting.cpp:(.text._ZN11xercesc_2_613XMLAttDefListD0Ev[xercesc_2_6::XMLAttDefList::~XMLAttDefList()]+0x2f): undefined reference to `xercesc_2_6::XMemory::operator delete(void*)'

请帮忙。

警告表示您链接到的某些库依赖于其他共享库,并且在链接器的搜索路径中找不到这些库。 链接器手册描述了它如何在文档中形成-rpath-link选项的搜索路径

它们只是警告,因此不会导致您的链接失败。如果在运行时找不到这些必需的库,这将是一个问题,但在链接时不一定是问题。

如果要使警告静音,则需要找出哪个目录包含libicui18n.so.36libxalanMsg.so.110,并使用手册中描述的方法之一告诉链接器查找该目录。

最后一行是真正的问题,表示您没有链接到定义该符号的库。您需要找出它是哪个库并使用-lfoo链接到它,它可能会像-lxerces

>我重新安装了ICU 3.2而不是 3.6.It 然后工作正常。