转换C&子模块包括objective-C项目(linphone)作为框架或静态库? [英] Convert C & submodule included objective-C project (linphone) as a framework or static library?

查看:170
本文介绍了转换C&子模块包括objective-C项目(linphone)作为框架或静态库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想合并两个项目。

第一个项目


  1. 写在目标C和swift 2.3

  2. Pod依赖

  3. 有不同的目标

  4. 子模块依赖性

  1. Written in objective C and swift 2.3
  2. Pod dependencies
  3. Have different Targets
  4. Submodules dependencies

第二个项目

https://github.com/BelledonneCommunications/linphone


  1. 用Objective C编写

  2. 对用C语言编写的linphone SDK的依赖

  3. 子模块依赖

如何将第二个项目(linphone)转换为框架?

How can I convert Second project(linphone) as a framework?


编辑1

我已经集成了linphone项目(第二个项目),包括C
编写的linphone SDK和Rectified all编译时错误。现在i
能够运行该项目。但是我将对Submodules依赖项做些什么?

I have integrated linphone project(second project) including the C written linphone SDK and Rectified all compile time errors. and now i am able to run the project. But what I will do for Submodules dependencies?

编辑2

按照现在,使用我们自己的SIP服务器帐户登录。正确
现在我的问题是

As per now, succeed login with our own SIP server account. Right now my issue is

LinphoneManager
 - (void)createLinphoneCore
 - theLinphoneCore = linphone_core_new_with_config(&linphonec_vtable, _configDb, (__bridge void *)(self)); 

theLinphoneCore为NULL,为什么?

注意:我还没有整合子模块,但我可以做音频&视频通话一切正常。

NOTE: Still i didnt integrate submodules, but i can do audio & video call everything works fine.


推荐答案

构建完整的liblinphone SDK唯一合理的方法是通过适当的客户端存储库,例如linphone-iphone或linphone-android。正如您所发现的那样,可以使用以下方式构建框架或静态库:

The only sane way to build a complete liblinphone SDK is through the appropriate client repository, e.g. linphone-iphone or linphone-android. As you have discovered, it is possible to build as a framework or static library using:

./ prepare.py -c&& ./prepare.py-DENABLE_STATIC_ONLY = ON&&制造&& make zipsdk

为libs设置DENABLE_STATIC_ONLY = ON,为框架设置= OFF:

Set DENABLE_STATIC_ONLY=ON for libs, and =OFF for a framework:

请注意:截至2017年6月,框架配置仍在开发中。它在模拟器和实际硬件上构建和运行,但由于子框架配置不正确,因此无法将生成的应用程序二进制文件提交给Apple。如果您不需要提交(甚至不是TestFlight!)2-6个月,他们很快就会完成。

Be aware: as of June 2017, the framework configuration is still under development. It builds and runs in the simulator and on actual hardware, but the resulting app binary can't be submitted to Apple because the sub-frameworks aren't configured correctly. If you don't need to submit (not even TestFlight!) for 2-6 months maybe they will finish up soon.

如果您需要更快的功能产品,请使用静态lib配置。唯一棘手的部分是在项目/工作区中设置所有内容。

If you need a functional product sooner, use the static lib configuration. The only tricky part is getting everything set up in your project/workspace.


  1. 使用上面的prepare.py完全清理和构建

  2. 解压缩sdk zip文件liblinphone-sdk进入你自己的项目目录

  3. 将liblinphone-sdk / apple-darwin / lib中的库添加到General下的XCode的Linked Frameworks and Libraries部分。单击+,选择添加其他,导航到libs目录。不要忘记在liblinphone-sdk / apple-darwin / lib / mediastreamer / plugins中包含任何内容

  4. 您可能需要为标题搜索路径添加构建设置 $(SRCROOT)/ liblinphone -sdk / apple-darwin / include

  5. 您可能需要为库搜索路径添加构建设置 $(PROJECT_DIR)/ liblinphone -sdk / apple-darwin / lib

  6. linphone-iPhone的XCode项目是发现您可能需要的其他调整的好地方制作。

  1. Do a full clean and build using prepare.py as above
  2. Extract the sdk zip file into your own project directory as liblinphone-sdk
  3. Add the libraries in liblinphone-sdk/apple-darwin/lib to XCode's Linked Frameworks and Libraries section under General. Click +, select "Add Other", navigate to the libs directory. Don't forget to include any in liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins
  4. You may need to add a Build Setting for Header Search Path $(SRCROOT)/liblinphone-sdk/apple-darwin/include
  5. You may need to add a Build Setting for Library Search Path $(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib
  6. The XCode project for linphone-iPhone is a good place to discover other tweaks you may need to make.

设置工作区可能需要反复试验。 Xcode对错误不是很好,但您应该能够使用Report Navigator视图查看完整的构建日志和错误消息。例如,如果你有一个未定义的符号,你可以尝试 grep -ri SYMBOLNAME liblinphone-sdk 来找出可能缺少的库。

Setting up your workspace will probably require trial and error. Xcode is not great with the errors but you should be able to use the Report Navigator view to see complete build logs and error messages. If you have an undefined symbol for example, you can try grep -ri SYMBOLNAME liblinphone-sdk to figure out what library might be missing.

关于 EDIT 2 问题,您需要所有子模块,否则它将无效。 ortp,belle-sip,mediastreamer,srtp,mbedtls,它们都是必不可少的。只有mediastreamer插件编解码器(有些)是可选的。

Regarding your EDIT 2 question, you need all the submodules or it won't work. ortp, belle-sip, mediastreamer, srtp, mbedtls, they are all essential. Only the mediastreamer plugin codecs are (somewhat) optional.

这篇关于转换C&子模块包括objective-C项目(linphone)作为框架或静态库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆