使用ndk开发android 5.0 平台错误处理(1)

现象:

使用ndk环境编译c/C++程序在android上运行时出现如下错误:

error: only position independent executables (PIE) are supported

原因:

Lollipop feature. See Security Enhancements in Android 5.0.

解决方案:

编译和链接时使用 -pie -fpie选项

关于pie的介绍:

http://www.liudonghua.com/?p=367

你可能感兴趣的:(使用ndk开发android 5.0 平台错误处理(1))