Chinaunix首页 | 论坛 | 博客
  • 博客访问: 440153
  • 博文数量: 145
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1060
  • 用 户 组: 普通用户
  • 注册时间: 2013-08-22 11:52
个人简介

专注计算机技术: Linux Android 云计算 虚拟化 网络

文章分类

全部博文(145)

文章存档

2016年(3)

2015年(21)

2014年(75)

2013年(46)

我的朋友

分类: iOS平台

2014-10-19 09:03:20

Q:  A company has asked me to deliver them a c/c++ library. They want to use it in an iphone app, which is objective c based.

I would prefer to deliver a library as opposed to code.

Could they wrap the c/c++ library into their iphone app without any need to see the source code?

Thanks.                 Asked Jul 22 '13 at 11:33   
A1: Did you mean static libraries ? –  Maulik Jul 22 '13 at 11:41 
RA1: Hi Maulik. Yes, I guess it will have to be a static library. I know very little about iphone development and xcode. Can you use a shared library in this environment in the same way you would use a .so, .dll or .dylib in linux/win/Mac ? thanks –  WewillSee Jul 22 '13 at 11:50 
A2: You cannot dynamically load a library in iOS. You can use a static library however. – 

A3: From what i understand you want to deliver a binary file for them to use in the application. If that is true then Yes it is possible but there is a catch you need to compile the library using the x code compiler for C++, and make sure that anything you use in your library is compatible whit the compiler.(make sure the library is compatible with armv7 and armv7s architectures). And as for the wrapper, there is no need for wrappers , they can use directly the c++ syntax inside code in .mm files. but if it's a must then they can use a wrapper generator to build the wrapper. --Radu
RA3: Hi Radu, thanks for your answer. OK, so the process is: 1- In XCode, to create a static library project 2- To add all the c/c++ code to the project (.cpp and .h) 3- Compile using xcode compiler to ensure armv7 and armv7s compatibility. is this correct?                 –                                                      
RRA3: There are serval ways of doing it, i prefer to compile using Terminal commands and write the makefiles for the compiler, but you are correct using in the above method it works the same. here is a tutorial about it neilmonday.blogspot.ro/2008/02/…                –                                             

阅读(612) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~