ndk-build编译64位.so,出现ndk error: cast from 'int*' to 'int' loses precision [-fpermissive]
2017-10-24 15:36
1101 查看
这是因为Linux 64位系统上指针类型占用8个字节,而int类型占用4个字节,所以会出现loses precision。
可以先将int* 转成long类型,long类型可以隐式类型转换到int类型,如下:
这样就不会报编译错误了。
作者:lb377463323
出处:http://blog.csdn.net/lb377463323
原文链接:http://blog.csdn.net/lb377463323/article/details/78330249
转载请注明出处!
可以先将int* 转成long类型,long类型可以隐式类型转换到int类型,如下:
int func() { int *p; p = //赋值 return (long)p; }
这样就不会报编译错误了。
作者:lb377463323
出处:http://blog.csdn.net/lb377463323
原文链接:http://blog.csdn.net/lb377463323/article/details/78330249
转载请注明出处!
相关文章推荐
- 关于Linux下C编译错误(警告)cast from 'void*' to 'int' loses precision
- x86_64 xercexc: error: cast from 'const void*' to 'long int' loses precision [-fpermissive]
- 关于Linux下C编译错误(警告)cast from 'void*' to 'int' loses precision
- error: cast from ‘char*’ to ‘int’ loses precision
- error: cast from ‘void*’ to ‘int’ loses precision
- error: cast from ‘char*’ to ‘int’ loses precision
- ubuntu16.04下编译caffe出现.build_release/lib/libcaffe.so: undefined reference to google ::protobuf...的问题
- ndk-build 编译报错 fatal error: error writing to -: Invalid argument } ^
- error: cast from ‘char*’ to ‘int’ loses precision
- error: cast from ‘char*’ to ‘int’ loses precision
- 关于python setup build编译出现找不到 vcvarsall.bat(error: Unable to find vcvarsall.bat)
- Android之jni编译出现error: jump to label ‘XXXX’ [-fpermissive]解决办法
- ndk-build 编译报错 fatal error: error writing to -: Invalid argument } ^
- keil(MDK)中出现error: #513: a value of type "int" cannot be assigned to an entity of type "char *",即函数返
- 解决NDK出现error: exception handling disabled, use -fexceptions to enable的问题
- 出现错误Error:Failed to find Build Tools revision 23.0.2
- Win7 64位编译Python扩展解决”error: Unable to find vcvarsall.bat”问题
- 解决NDK出现error: exception handling disabled, use -fexceptions to enable的问题
- Android之ndk编译出现"undefined reference to method"解决办法
- 使用NDK编译的时候出现 undefined reference to