无法在eclipse中使用libxml ++
问题描述:
我需要将libxml ++添加到我的项目中。 libxml page表示使用以下方式编译代码。无法在eclipse中使用libxml ++
g++ program.cc -o program `pkg-config --cflags --libs libxml++-2.6`
我试过从终端和代码编译。但我想从eclipse构建代码。因此我加了pkg-config --cflags --libs libxml++-2.6
到project->properties->C/C++ build->settings->g++ compiler->miscellaneous->otherflags
。添加后,当我试图建立我收到错误。这是我的构建输出。 make all
Building file: ../src/main.cpp
Invoking: GCC C++ Compiler
g++ -E -O0 -g3 -Wall -c -fmessage-length=0 'pkg-config --cflags --libs libxml++-2.6' -MMD -MP -MF"src/main.d" -MT"src/main.d" -o "src/main.o" "../src/main.cpp"
g++: error: pkg-config --cflags --libs libxml++-2.6: No such file or directory
make: *** [src/main.o] Error 1
我在做什么错?请赐教。
答
对于库,使用pkg-config
我使用这个Pkg-config
插件eclipse
:
https://marketplace.eclipse.org/content/pkg-config-support-eclipse-cdt
从选择要使用的包对每一个项目:
Project -> Properties -> C/C++ Build -> Settings
选择Pkg-config
标签。
我用这个:https://marketplace.eclipse.org/content/pkg-config-support-eclipse-cdt – Galik
@Galik您的解决方案部分的工作。我仍然有构建错误。 – Kumar
@Galik它完美的工作。你可以提到这个答案。谢谢。 – Kumar