码迷,mamicode.com
首页 > 其他好文 > 详细

error: qrc_qml.obj: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC解决办法

时间:2014-09-14 16:39:27      阅读:415      评论:0      收藏:0      [点我收藏+]

标签:android   http   io   使用   ar   for   文件   sp   代码   

使用qtcreator加androidndk编译项目时报错:

error: qrc_qml.obj: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC

error: undefined reference to ‘__dso_handle‘

解决方案,建一个头文件,代码如下,包含到项目里:

#define NS_EXPORT

extern "C" {
/*
 * To work around http://code.google.com/p/android/issues/detail?id=23203
 * we don‘t link with the crt objects. In some configurations, this means
 * a lack of the __dso_handle symbol because it is defined there, and
 * depending on the android platform and ndk versions used, it may or may
 * not be defined in libc.so. In the latter case, we fail to link. Defining
 * it here as weak makes us provide the symbol when it‘s not provided by
 * the crt objects, making the change transparent for future NDKs that
 * would fix the original problem. On older NDKs, it is not a problem
 * either because the way __dso_handle was used was already broken (and
 * the custom linker works around it).
 */
  NS_EXPORT __attribute__((weak)) void *__dso_handle;
}

error: qrc_qml.obj: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC解决办法

标签:android   http   io   使用   ar   for   文件   sp   代码   

原文地址:http://www.cnblogs.com/yuanxiaoping_21cn_com/p/3971162.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!