iOS开发--一个工程中添加多个工程
来源:互联网 发布:高效阅读的软件 编辑:程序博客网 时间:2024/05/01 22:46
下面举例了添加ZXing到自己的project中,其他的类似:
After an upgrading to Xcode 4, I have been having trouble compiling my own ZXing iOS project.
So I decided to explain you how to install easily ZXing with Xcode 4.
First of all (for those who don’t know), ZXing is an open-source library to read the 1D/2D barcodes. This library is available on many platforms such as the iOS, Android, Blackberry, ect. You can find it here: http://code.google.com/p/zxing/.
Before to start, be sure that you have the latest version of ZXing on your computer. If you don’t, you must download it via a SVN client here: http://zxing.googlecode.com/svn/trunk/.
To use ZXing into your project in Xcode 4 follow these steps:
- Firstly go to the “zxing/iphone/ZXingWidget/” and drag and drop the ZXingWidget.xcodeproj file onto your Xcode “Project navigator” sidebar. If a dialog appears uncheck the “Copy items” and verify that the “Reference Type” is “Relative to Project” before clicking “Add”.
- Now we are going to add ZXingWidget as a dependency of your project to allow Xcode to compile it whenever you compile the main project:
- First select your project file in the “Project navigator”.
- Then select the corresponding target.
- After choose the “Build Phases” tab and expand the “Target Dependencies” section.
- Click the “+” (add) button to display a dialog.
- To finish add the “ZXingWidget” target as shown above.
- Now we are going to link the ZXingWidget static library (libZXingWidget.a) to the project:
- Firstly choose the “Build Phases” tab and expand the “Link Binary With Libraries” section.
- Then click the “+” (add) button to display a dialog.
- To finish add the “libZXingWidget.a” which is located in the “Workspace” category as shown above.
- By the way add the following iOS frameworks too:
- AddressBook
- AddressBookUI
- AudioToolbox
- AVFoundation
- CoreMedia
- CoreVideo
- libiconv.dylib
- Then you must configure the header search path of your project to allow Xcode to find the ZXingWidget headers. To do that:
- In the “Project navigator” select the main project (not the target).
- Go to the “Build Settings” tab and search the “Header Search Paths“.
- Double-click on it and add:
- The full path of the “zxing/iphone/ZXingWidget/Classes” directory. Check the “recursive path“.
- The full path of the “zxing/cpp/core/src/” directory. Uncheck the “recursive path“.
Now you just have to import the “ZXingWidgetController.h” and the “QRCodeReader.h” to your project and use them.
Attention: Make sure that the files in which you are using the ZXing headers have the .mm extension because they use c++ library files.
转自:http://yannickloriot.com/2011/04/how-to-install-zxing-in-xcode-4/
- iOS开发--一个工程中添加多个工程
- iOS开发将一个工程添加到另一个工程中
- VS2008 Express:在一个解决方案中添加多个工程
- XCode一个工程中添加多个Targets教程
- iOS 开发 Xcode 一个工程 Project 创建多个 target
- MFC一个工程添加多个项目
- ios一个工程的多个target
- iOS工程中添加cocoapods
- iOS如何往当前工程再添加一个工程
- [IOS]在一个工程管理多个应用
- unity工程中添加多个相机后警报
- Codeblocks: 在工作空间中添加多个工程
- 将一个工程添加到另一个工程中
- 在iOS工程中添加ASIHTTPRequest
- ios 如何添加字体到工程中
- vs2010多个工程开发
- <IOS>Xcode中一个工程如何引用另一个工程
- 一个工程中如何包含多个web.config?
- 使用Memcached实现Session共享
- 15个程序员需要知道的Chrome扩展
- Activity生命周期
- webstorm9 注册码
- CPSR和SPSR
- iOS开发--一个工程中添加多个工程
- Linux基础1-文件的权限和归属
- Linux那些事儿 之 戏说USB(18)设备的生命线(一)
- linux上安装http proxy(http代理)服务器
- [leetcode]Insertion Sort List
- Android 流式布局FlowLayout
- ContentProvider数据库共享之——MIME类型与getType()
- 欢迎使用CSDN-markdown编辑器
- 辛星整理Linux下常用的gcc参数