使用 Visual Studio 构建 dll
build dlls using Visual Studio
我想使用Visual Studio构建dll,我想在Matlab中将其用作函数。
在这样做的时候,我使用了 declspec(dllimport) 函数...但是我收到编译错误LNK2019:未解析的外部sumbol?
感谢您的帮助。
#ifdef PRC50CONTROL_EXPORTS
#define PRC50CONTROL_API __declspec(dllexport)
#else
#define PRC50CONTROL_API __declspec(dllimport)
#endif
int PRC50CONTROL_API SetPRC50Gain(double inGain);
int PRC50CONTROL_API SetPRC50Gain(double inGain);
在 __declspec() 之前有返回类型
将其移至
PRC50CONTROL_API int SetPRC50Gain(double inGain);
另外,显然,请确保您有
PRC50CONTROL_EXPORTS
在要从中导出符号的库的标题中定义。
相关文章:
- 如何从Cygwin下构建的C++程序链接到DLL
- 为什么它无法在 c++ 中全局声明一个构建为 dll 文件的类?
- C\C++构建的dll在LabView中实时运行
- 如何在没有任何依赖库的情况下在Visual Studio中构建dll?
- MFC/DLL中缺少ATL :: CSTRINGT功能,该功能与Clang/vs-2019构建
- Microsoft Visual Studio 2008,版本9.0.30739.1 SP,DLL构建错误
- 如何在 go 中调用带有 .lib 和.dll文件的预构建 API
- 在构建服务器上将 dll C++生成到两个平台 (x86+x64)
- 复制C DLL以构建任何C#项目的输出,以扩展为参考
- 如何在C 构建器中动态声明C#DLL
- 如何在运行时构建DLL
- 构建不依赖于MSVCR120.DLL的自定义英特尔 MKL DLL
- 当您的外部SDK仅具有.dll,.lib,.h文件时,如何链接和构建项目
- 使用Cmake与Visual Studio 2017一起构建ssh.dll
- CodeBlocks:如何使用wxWidgets库DLL构建C++应用程序
- 如何使用Cmake为SimuroSot模拟器构建(从DevCpp转换)Win32 DLL
- 节点插件节点-gyp 构建缺少 V8 dll 的
- 调用从.NET Core中的C++项目构建的.dll时出现BadImageFormatException
- 制定目标需要32和64位的DLL构建
- 内联类函数和共享库(dll)构建