简体   繁体   English

Xcode:如何使用库设置C ++项目

[英]Xcode: How to set up a C++ Project with Libraries

I am very new to C++ and have been following some tutorials online. 我是C ++的新手,并且一直在线学习一些教程。 I have downloaded the libraries and .h files they use and included them in my file structure. 我已经下载了他们使用的库和.h文件,并将它们包含在我的文件结构中。

However I get this error: 但是我收到此错误:

'Apple Mach-0 Linker (id) Error...' 'Apple Mach-0 Linker(id)错误......'

What does this mean exactly? 这究竟是什么意思?

The simplest way is to: 最简单的方法是:

Open Xcode. 打开Xcode。 Go to: 去:

File -> New -> Project -> Mac OS X -> Application -> Command Line Tool

Specify project name and set type to C++ 指定项目名称并将类型设置为C++

To add libraries you have to specify the header search paths and path to .a files. 要添加库,您必须指定标题搜索路径和.a文件的路径。 It can be done in project build settings 它可以在项目构建设置中完成

You might want to take a look here: header search path in XCode 4 您可能需要查看此处: XCode 4中的标题搜索路径

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

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