歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> 如何在XCode中配置Boost庫

如何在XCode中配置Boost庫

日期:2017/3/1 9:46:32   编辑:Linux編程

由於boost庫在項目開發過程中使用的非常的頻繁,且被成為“准標准庫”,業界對其認可度較高,因此為了防止每次創建項目時都更改一次project配置,我決定將boost頭文件和編譯好的庫統一放在xcode的默認搜索路徑下。那麼如何查看xcode的默認搜索路徑呢?

#include<libxml/parser.h>

For testing, I ran:

echo '#include <libxml/parser.h>'| xcrun clang++ -xc -v -

which gives me

#include"..." search starts here:#include<...>

search starts here:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0/include/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks(framework directory)End of search list.<stdin>:1:10: fatal error:'libxml/parser.h' file not found#include<libxml/parser.h>

通過上面的命令可知道xcode的默認搜索路徑。然後將boost的頭文件和編譯好的庫放到下面即可。這樣boost庫就像stl標准庫一樣被使用了。

Copyright © Linux教程網 All Rights Reserved