在C+中动态加载DLL+;适用于Linux平台 我尝试使用VisualStudio从Windows C++项目中使用同一个头和.CPP< /Cord>文件创建Linux C++项目。我正在使用下面的函数在Windows中动态加载DLL HINSTANCE hGetProcIDDLL=LoadLibraryA(sDllPath.c_str()); getplugininfo列表GetInfoList=(getplugininfo列表)GetProcAddress(hGetProcIDDLL,“getplugininfo列表”);
我认为这些函数来自在C+中动态加载DLL+;适用于Linux平台 我尝试使用VisualStudio从Windows C++项目中使用同一个头和.CPP< /Cord>文件创建Linux C++项目。我正在使用下面的函数在Windows中动态加载DLL HINSTANCE hGetProcIDDLL=LoadLibraryA(sDllPath.c_str()); getplugininfo列表GetInfoList=(getplugininfo列表)GetProcAddress(hGetProcIDDLL,“getplugininfo列表”);,c++,linux,C++,Linux,我认为这些函数来自 P>当到Linux C++项目时,我没有得到这些功能。 对于Linux C++,什么是代码< > HStase和 LoadLibraryA < /C> >?/P> < P>我在这里发布我的答案。谢谢大家的支持 typedef CPluginInfoList(*GetPluginInfoList)(void); #if _WINDLL HINSTANCE hGetProcIDDLL = LoadLibraryA(sDllPath.c_str()); #else
<> P>当到Linux C++项目时,我没有得到这些功能。
对于Linux C++,什么是代码< > HStase和<代码> LoadLibraryA < /C> >?/P> < P>我在这里发布我的答案。谢谢大家的支持
typedef CPluginInfoList(*GetPluginInfoList)(void);
#if _WINDLL
HINSTANCE hGetProcIDDLL = LoadLibraryA(sDllPath.c_str());
#else
void* hGetProcIDDLL = dlopen(sDllPath.c_str(), RTLD_LAZY);
#endif
#if _WINDLL
GetPluginInfoList GetInfoList = (GetPluginInfoList)GetProcAddress(hGetProcIDDLL, "GetPluginInfoList");
#else
GetPluginInfoList GetInfoList = (GetPluginInfoList)dlsym(hGetProcIDDLL, "GetPluginInfoList");
#endif
GetInfoList(); //Function Call
我把我的答案贴在这里。谢谢大家的支持
typedef CPluginInfoList(*GetPluginInfoList)(void);
#if _WINDLL
HINSTANCE hGetProcIDDLL = LoadLibraryA(sDllPath.c_str());
#else
void* hGetProcIDDLL = dlopen(sDllPath.c_str(), RTLD_LAZY);
#endif
#if _WINDLL
GetPluginInfoList GetInfoList = (GetPluginInfoList)GetProcAddress(hGetProcIDDLL, "GetPluginInfoList");
#else
GetPluginInfoList GetInfoList = (GetPluginInfoList)dlsym(hGetProcIDDLL, "GetPluginInfoList");
#endif
GetInfoList(); //Function Call
你正在寻找<代码> DLOpen< /COD>和