Hi我在c++中构建库,并在c++中打开dll程序,它就可以工作了。问题是,当我想使用qt打开我的dll时,它会加载符号,但在那之后,当我想要使用它并调用一些函数时,我遇到了系统异常。我读到混合libgcc_s.so.1可能是问题所在,但我不知道原因是什么。
/tmp/install (3)/Release$ musl-ldd ./libx.so
musl-ldd (0x7fca78cea000)
Error loading shared library libgcc_s.so.1: No such file or directory (needed by ./libx.so)
libc.musl-x86_64.so.1 => musl-ldd (0x7fca78cea000)
Error relocating ./libx.so: _Unwind_GetIPInfo: symbol not found
Error relocating ./libx.so: _Unwind_RaiseException: symbol not found
Error relocating ./libx.so: _Unwind_SetGR: symbol not found
Error relocating ./libx.so: _Unwind_GetDataRelBase: symbol not found
Error relocating ./libx.so: _Unwind_GetLanguageSpecificData: symbol not found
Error relocating ./libx.so: _Unwind_GetTextRelBase: symbol not found
Error relocating ./libx.so: _Unwind_DeleteException: symbol not found
Error relocating ./libx.so: _Unwind_GetRegionStart: symbol not found
Error relocating ./libx.so: _Unwind_Resume: symbol not found
Error relocating ./libx.so: _Unwind_SetIP: symbol not found
Error relocating ./libx.so: _Unwind_Resume_or_Rethrow: symbol not found
我有内核错误:
Oct 25 22:52:31 x-VirtualBox kernel: [176384.989436] dlloader-x[4110792]: segfault at 0 ip 000055a23feac63e sp 00007fff15948050 error 4 in dlloader-x[55a23fea9000+5000]
Oct 25 22:52:31 x-VirtualBox kernel: [176384.989441] Code: 87 69 00 00 48 89 c7 e8 00 d4 ff ff 48 8d 85 50 ff ff ff 48 89 c7 e8 37 d5 ff ff 48 8d 85 50 ff ff ff 48 89 c7 e8 a0 01 00 00 <48> 8b 10 48 83 c2 10 48 8b 12 48 89 c7 ff d2 48 c7 85 28 ff ff ff
我试着链接libc静态,但没有困难,可能是qt链接器的问题?有人能帮忙吗?
您的问题是链接器根本找不到libgcc_s.so。这个库是gcc的运行库,它与libc没有任何关系(请确保不要将其与glibc混淆)
如果您在高山上,请安装libgcc
软件包。
如果没有,请确保它存在于musl动态链接器的搜索路径中。