1
我需要將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
我在做什麼錯?請賜教。
我用這個:https://marketplace.eclipse.org/content/pkg-config-support-eclipse-cdt – Galik
@Galik您的解決方案部分的工作。我仍然有構建錯誤。 – Kumar
@Galik它完美的工作。你可以提到這個答案。謝謝。 – Kumar