Xerces 安装后找不到库
Xerces no library found after install
我正在尝试 运行 Xerces on Mac。我我们
./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)
知道如何解决这个问题吗?
谢谢!
- Select 项目中的项目 window。
- 右键单击弹出菜单。
- Select
Properties
在弹出菜单中。
- Select
C++ Compiler
在对话框左侧的类别列表中 Build
下。
- 将目录添加到
Include Directories
。新目录应该在该目录的 xercesc/util/
子目录中有 PlatformUtils.hpp。根据您的选择,我猜测 /opt/include/
更新
解决
ld: library not found for -lxerces-c
- Select
Linker
在对话框左侧的类别列表中 Build
下。
- 将包含
libxerces-c.dylib
and/or libxerces-c.a
的目录添加到 Additional Library Directories
字段。
我正在尝试 运行 Xerces on Mac。我我们
./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)
知道如何解决这个问题吗?
谢谢!
- Select 项目中的项目 window。
- 右键单击弹出菜单。
- Select
Properties
在弹出菜单中。 - Select
C++ Compiler
在对话框左侧的类别列表中Build
下。 - 将目录添加到
Include Directories
。新目录应该在该目录的xercesc/util/
子目录中有 PlatformUtils.hpp。根据您的选择,我猜测/opt/include/
更新
解决
ld: library not found for -lxerces-c
- Select
Linker
在对话框左侧的类别列表中Build
下。 - 将包含
libxerces-c.dylib
and/orlibxerces-c.a
的目录添加到Additional Library Directories
字段。