简体   繁体   English

Xcode C ++库位置

[英]Xcode C++ library location

I'm pretty new to Xcode and C++. 我对Xcode和C ++很陌生。 I was wondering if there is a place to store custom libraries so that I don't have to drag them into each project. 我想知道是否有地方可以存储自定义库,这样我就不必将它们拖到每个项目中。 I'd like to be able to just say '#include "mylib.h"' 我想只能说'#include“ mylib.h”'

Is that possible? 那可能吗?

Mac like any other system use /usr/include, /usr/lib and /usr/local/include, /usr/local/lib. Mac与其他任何系统一样,都使用/ usr / include,/ usr / lib和/ usr / local / include,/ usr / local / lib。

Additionaly in XCode < 4.2 you can find headers and libs in /Developer/SDKs/MacOSX10.X.sdk/usr/lib 另外,在XCode <4.2中,您可以在/Developer/SDKs/MacOSX10.X.sdk/usr/lib中找到标头和库

in XCode >= 4.3 this sdk is inside /Application/Xcode.app bundle you can assign include directory using -I parameter to specify include dir path, and -L to specify lib dir path. 在XCode> = 4.3中,此sdk位于/Application/Xcode.app捆绑包中,您可以使用-I参数指定包含目录路径,使用-L指定lib目录路径,从而指定包含目录。 Both can be add in build settings in project settings 两者都可以在项目设置中的构建设置中添加

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM