【问题标题】:Xerces no library found after installXerces 安装后找不到库
【发布时间】:2015-11-06 04:16:29
【问题描述】:

我正在尝试在 Mac 上运行 Xerces。我是我们

 ./configure CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" 
./configure --prefix=/opt
        sudo make (this builds the library)
        sudo make install (this installs the library)

我还在 NetBeans 中的链接器上包含 libxerces-c.dylib

这是错误

 "/Applications/Xcode.app/Contents/Developer/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
"/Applications/Xcode.app/Contents/Developer/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/xerces
mkdir -p build/Debug/GNU-MacOSX/_ext/619588065
rm -f "build/Debug/GNU-MacOSX/_ext/619588065/SAXCount.o.d"
g++    -c -g -I/opt/lib/libxerces-c.dylib -MMD -MP -MF "build/Debug/GNU-MacOSX/_ext/619588065/SAXCount.o.d" -o build/Debug/GNU-MacOSX/_ext/619588065/SAXCount.o ../../Documents/xerces-c-3.1.2/samples/src/SAXCount/SAXCount.cpp
In file included from ../../Documents/xerces-c-3.1.2/samples/src/SAXCount/SAXCount.cpp:26:
../../Documents/xerces-c-3.1.2/samples/src/SAXCount/SAXCount.hpp:26:10: fatal error: 'xercesc/util/PlatformUtils.hpp' file not found
#include <xercesc/util/PlatformUtils.hpp>
         ^
1 error generated.
make[2]: *** [build/Debug/GNU-MacOSX/_ext/619588065/SAXCount.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 128ms)

知道如何解决这个问题吗?

谢谢!

【问题讨论】:

    标签: c++ c netbeans xerces


    【解决方案1】:
    1. 在项目窗口中选择项目。
    2. 右键单击弹出菜单。
    3. 在弹出菜单中选择Properties
    4. 在对话框左侧的“类别”列表中选择Build 下的C++ Compiler
    5. 将目录添加到Include Directories。新目录的 xercesc/util/ 子目录中应该有 PlatformUtils.hpp。从你的选择我猜/opt/include/

    更新

    解决

    ld: 找不到 -lxerces-c 的库

    1. 在对话框左侧的“类别”列表中选择Build 下的Linker
    2. 将包含libxerces-c.dylib 和/或libxerces-c.a(似乎是/opt/lib/)的目录添加到Additional Library Directories 字段。

    【讨论】:

    • 您好,谢谢您的回答。我这样做了,但仍然遇到同样的错误
    • 哪个目录包含文件PlatformUtils.hpp?什么 -I 标志被传递给编译器?顺便说一句-I/opt/lib/libxerces-c.dylib 没有意义,您应该将包含 .h 和 .hpp 文件的包含目录放在包含路径上,而 -I 而不是 .dylib 文件。
    • 包含 PlatformUtils.hpp 的目录是 /opt/lib/libxerces-c.dylib 我在 /lib 中没有看到说 .h 或 .hpp 文件 这里是文件列表 libxerces-c-3.1.dylib libxerces-c.a @987654340 @libxerces-c.la
    • 这句话:包含PlatformUtils.hpp的目录是/opt/lib/libxerces-c.dylib 似乎与该目录中的文件列表不包含PlatformUtils.hpp的说法直接矛盾。
    • 嗨,我做到了,现在#include &lt;xercesc/util/PlatformUtils.hpp&gt; ^ 1 error generated. 走了,一些错误仍然存​​在。请看下面的链接link
    猜你喜欢
    • 2011-04-06
    • 2013-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-24
    • 2017-08-02
    • 2016-04-10
    • 1970-01-01
    相关资源
    最近更新 更多