arm-linux-androidabi/bin/ld:致命错误:-soname:必须采用非空参数
arm-linux-androideabi/bin/ld: fatal error: -soname: must take a non-empty argument
我正在与cmake android交叉编译gdcm,它一直到编译结束,但最后我得到了以下错误。在编译库时,你们如何在cmakegui或cmake中设置-soname,这样我们就可以避免下面的错误。
/opt/android/android-ndk-r10c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux- androideabi/bin/ld: fatal error: -soname: must take a non-empty argument
collect2: error: ld returned 1 exit status
make[2]: *** [/home/likewise-open/SLKTECHLABS/kirtan.patel/Desktop/GDCM/GDCMSource/libs/armeabi-v7a/libgdcmjni.so] Error 1
make[1]: *** [Wrapping/Java/CMakeFiles/gdcmjni.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/kirtan.patel/Desktop/GDCM/GDCMSource/Source/MediaStorageAndFileFormat/gdcmImageWriter.h:36: Warning 822: Covariant return types not supported in Java. Proxy method will return gdcm::Pixmap const &.
/home/kirtan.patel/Desktop/GDCM/GDCMSource/Source/MediaStorageAndFileFormat/gdcmImageCodec.h:45: Warning 473: Returning a pointer or reference in a director method is not recommended.
正如Romanski所指出的,CMake版本3.2和3.0由于UseSWIG.cmake
文件的不同而具有不同的行为。在3.2中,默认启用的NO_SONAME
属性看起来会在android构建中引发冲突,从而产生无效的链接选项-Wl,-soname,
和空的TARGET_SONAME。
有两种方法可以修复3.2版本的构建
string(REPLACE "<CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME>" "" CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE}")
完全消除了断开的链接选项set_target_properties(${MY_TARGET} PROPERTIES NO_SONAME OFF)
用正确的so名称修复断开的链接选项
相关文章:
- 如何反转整数参数包
- 使用C++库在Android项目中修改gradle中的cmake参数,用于插入指令的测试
- 如何使用默认参数等选择模板专业化
- 模板参数替换失败,并且未完成隐式转换
- 具有默认模板参数的多态类的模板推导失败
- lambda参数转换为constexpr技巧,然后获取带链接的数组
- 将数组作为参数传递给函数安全吗?作为第三方职能部门,可以探索他们想要的之外的其他元素
- 函数调用中参数的顺序重要吗
- 部分定义/别名模板模板参数
- 模板-模板参数推导:三个不同的编译器三种不同的行为
- 使用不带参数的函数访问结构元素
- 基于另一个成员参数将函数调用从类传递给它的一个成员
- 如何在OMNET++中指定与命令行参数组合的输出文件名
- 如何使用Luacneneneba API正确读取字符串和表参数
- 在派生函数中指定void*参数
- 视图中的参数推导失败:take_while
- static_assert在宏中,但也可以扩展到可以用作函数参数的东西
- 使用指向成员的指针将成员函数作为参数传递
- 没有名称的C++模板参数
- arm-linux-androidabi/bin/ld:致命错误:-soname:必须采用非空参数