dlopen()失败怎么办?

简介: dlopen()失败怎么办?

所谓失败,就是得到的结果是NULL。出现这种情况,经过搜索,有两种情况:


路径错了。这个时候,复制路径后粘贴;使用函数判断文件是否存在。

文件复制错了。

so编译时,没有加-shared,-fPIC参数。解决办法就是加上后重新编译。

 三种情况都检查一遍。



 调试办法:


失败判断加一句printf("%s\n", dlerror()),参考https://blog.csdn.net/quantum7/article/details/102806432

ldd查看。用处不大。

目录
相关文章
解决:Oops internal error 40343 occured.Further work is not possible and IDA will close (打开文件出现40343错误)
解决:Oops internal error 40343 occured.Further work is not possible and IDA will close (打开文件出现40343错误)
394 0
|
C++
DLL调用异常:The value of ESP was not properly
DLL调用异常:The value of ESP was not properly
90 0
编译Ffmpeg错误:strsafe.h:1859:11: error: ‘WEOF‘ undeclared
编译Ffmpeg错误:strsafe.h:1859:11: error: ‘WEOF‘ undeclared
106 0
解决:Oops! internal error 40343 occured.Further work is not possible and IDA will close(打开文件出现40343错误)
解决:Oops! internal error 40343 occured.Further work is not possible and IDA will close(打开文件出现40343错误)
675 0
解决:Oops! internal error 40343 occured.Further work is not possible and IDA will close(打开文件出现40343错误)
runnerw.exe: CreateProcess failed with error 216:
runnerw.exe: CreateProcess failed with error 216:
213 0
成功解决OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 / cairo.so.2
成功解决OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 / cairo.so.2
成功解决OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 / cairo.so.2
dlopen()失败怎么办?
dlopen()失败怎么办?
603 0
|
C++
error LNK2005: DllMain 已经在MSVCRT.lib中定义
error LNK2005: DllMain 已经在MSVCRT.lib中定义
430 0
|
C++
C++ 操作DLL的函数 Loadlibrary GetProcAddress FreeLibrary
C++ 操作DLL的函数 Loadlibrary GetProcAddress FreeLibrary
803 0

热门文章

最新文章