platinum系统手机的服务器,mac系统platinum(Android)编译

platinum是一个使用比较广泛的dlna开源库,今天记录下platinum在mac电脑上的编译过程。

首先在github中搜索platinum

下载代码 git clone https://github.com/plutinosoft/Platinum

按照官方提示Android版本的编译步骤为

> scons target=arm-android-linux build_config=Release

> cd Source/Platform/Android/module/platinum

> ndk-build NDK_DEBUG=0

但是在编译过程中可能会碰到以下问题

1、配置ANDROID_NDK_ROOT

首先在~/.bash_profile中配置环境变量ANDROID_NDK_ROOT,我这里使用的ndk版本是r13b,例如:

# Add NDK for platinum

export ANDROID_NDK_ROOT=/Users/xxx/Library/Android/ndk/android-ndk-r13b

2、 scons: command not found

执行scons target=arm-android-linux build_config=Release

可能会出现 scons: command not found

需要安装 scons,方法brew install scons

3、arm-linux-androideabi-g++: command not found

再次执行scons target=arm-android-linux build_config=Release

提示 arm-linux-androideabi-g++: command not found

解决办法,参考https://blog.csdn.net/zangcf/article/details/42740261?locationNum=5

修改Build/Targets/arm-android-linux/Config.scons中的

ANDROID_CROSS_PREFIX = 'arm-linux-androideabi'

为绝对路径

ANDROID_CROSS_PREFIX = os.path.join(ANDROID_NDK_ROOT,'toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi')

4、fatal error: Neptune.h: No such file or directory

再次执行scons target=arm-android-linux build_config=Release

提示fatal error: Neptune.h: No such file or directory

在ThirdParty/目录下Neptune目录为空,需要单独下载Neptune

git clone https://github.com/plutinosoft/Neptune.git

下载成功之后再次执行

scons target=arm-android-linux build_config=Release

如果看到

scons: done building targets.

代表成功,之后再执行下面两条命令

cd Source/Platform/Android/module/platinum`

ndk-build NDK_DEBUG=0

如果一切顺利,会在 Source/Platform/Android/module/platinum/libs下生成libplatinum-jni.so

5、macOS 10.15可能碰到的问题

提示谨慎升级macOS 10.15

如果你已经升级了macOS10.15,编译过程中可能还会遇到以下问题

1)brew install secons执行异常

需要升级版本 brew update

2)xcrun: error: invalid active developer path, missing xcrun

需要重装command line tools

xcode-select –install

3)ndk编译的时候 clang++、clang 无法打开

需要在terminal执行以下命令

sudo xattr -r -d com.apple.quarantine /Users/xxx/Library/Android/ndk/android-ndk-r13b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++

sudo xattr -r -d com.apple.quarantine /Users/xxx/Library/Android/ndk/android-ndk-r13b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值