简体   繁体   English

如何在Xcode中导入C ++库?

[英]How to import C++ libraries in Xcode?

I'm using Xcode for developing a simple app. 我正在使用Xcode开发一个简单的应用程序。 I need a library called cURL, for manage simple connection methods, but I really dunno how to import this library in Xcode. 我需要一个名为cURL的库来管理简单的连接方法,但我真的不知道如何在Xcode中导入这个库。 I am programming in C++, and I know that isn't very a good idea program that on a Mac, but I haven't got other options. 我用C ++编程,我知道在Mac上这不是一个好主意的程序,但我没有其他选择。 Thanks in advance! 提前致谢!

libcurl is a standard library on Mac OS X - headers are in /usr/include/curl and libraries are in /usr/lib as you might expect. libcurl是Mac OS X上的标准库 - 标头位于/usr/include/curl ,库位于/usr/lib如您所料。

You can either just add the relevant header(s) and library(ies) to your project explicitly (makes looking stuff up easier and avoids having to set build flags), or you can do it the old skool way by specifying linker flags in the build settings. 您可以只是显式地向项目中添加相关的头文件和库(使查找内容更容易,并避免必须设置构建标志),或者您可以通过指定链接器标记来执行旧的skool方式。构建设置。

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

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