栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

C++学习(四零四)hidden symbol `atexit‘ in XXX is referenced by DSO

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

C++学习(四零四)hidden symbol `atexit‘ in XXX is referenced by DSO

执行如下语句时报错:

/bin/sh e:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/libtool --mode=link --silent D:/android-ndk-r19c/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android28-clang++  gdalinfo_bin.lo  e:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/libgdal.la  -o gdalinfo
D:android-ndk-r19ctoolchainsllvmprebuiltwindows-x86_64bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/binld: .libs/gdalinfo: hidden symbol `atexit' in D:android-ndk-r19ctoolchainsllvmprebuiltwindows-x86_64bin/../sysroot/usr/lib/aarch64-linux-android/28crtbegin_dynamic.o is referenced by DSO
D:android-ndk-r19ctoolchainsllvmprebuiltwindows-x86_64bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/binld: final link failed: Bad value
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

编译语句如下:

/bin/sh e:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/libtool --mode=compile --silent --tag=CXX D:/android-ndk-r19c/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android28-clang++ -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/port -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/gcore -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/alg -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/ogr -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/ogr/ogrsf_frmts -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/gnm -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/apps -g -O2  -Wall -Wextra -Winit-self -Wunused-parameter -Wformat -Werror=format-security -Wno-format-nonliteral -Wshorten-64-to-32 -Wshadow -Werror=vla -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-conversion -Wdocumentation -Wno-documentation-deprecated-sync -Wunused-private-field -Wmissing-prototypes -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual -fno-operator-names -Wzero-as-null-pointer-constant -Wimplicit-fallthrough  -fno-use-cxa-atexit -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/frmts/vrt -DGNM_ENABLED -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/port  -DGDAL_COMPILATION -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/ogr/ogrsf_frmts/geojson/libjson -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/ogr/ogrsf_frmts/geojson -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/ogr/ogrsf_frmts/generic -Ie:/osg-osgearth-source/other_3rdParty/gdal-2.3.2/gnm -c -o gdalinfo_bin.lo gdalinfo_bin.cpp

去掉编译选项 -fno-use-cxa-atexit 依然报错。

有地方提到增加编译选项-coverage,但是会报以下错:

.libs/gdalinfo_bin.o: In function `__llvm_gcov_writeout':
gdalinfo_bin.cpp:(.text+0x7f8): undefined reference to `llvm_gcda_start_file'
gdalinfo_bin.cpp:(.text+0x81c): undefined reference to `llvm_gcda_emit_function'
gdalinfo_bin.cpp:(.text+0x82c): undefined reference to `llvm_gcda_emit_arcs'
gdalinfo_bin.cpp:(.text+0x850): undefined reference to `llvm_gcda_emit_function'
gdalinfo_bin.cpp:(.text+0x860): undefined reference to `llvm_gcda_emit_arcs'
gdalinfo_bin.cpp:(.text+0x884): undefined reference to `llvm_gcda_emit_function'
gdalinfo_bin.cpp:(.text+0x894): undefined reference to `llvm_gcda_emit_arcs'
gdalinfo_bin.cpp:(.text+0x8b8): undefined reference to `llvm_gcda_emit_function'
gdalinfo_bin.cpp:(.text+0x8c8): undefined reference to `llvm_gcda_emit_arcs'
gdalinfo_bin.cpp:(.text+0x8cc): undefined reference to `llvm_gcda_summary_info'
gdalinfo_bin.cpp:(.text+0x8d4): undefined reference to `llvm_gcda_end_file'
.libs/gdalinfo_bin.o: In function `__llvm_gcov_init':
gdalinfo_bin.cpp:(.text+0x93c): undefined reference to `llvm_gcov_init'
D:android-ndk-r19ctoolchainsllvmprebuiltwindows-x86_64bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/binld: .libs/gdalinfo: hidden symbol `atexit' in D:android-ndk-r19ctoolchainsllvmprebuiltwindows-x86_64bin/../sysroot/usr/lib/aarch64-linux-android/28crtbegin_dynamic.o is referenced by DSO
D:android-ndk-r19ctoolchainsllvmprebuiltwindows-x86_64bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/binld: final link failed: Bad value
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/384528.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号