Load C/C++ shared library into MATLAB - '.dll is not a valid Win32 application'
15 次查看(过去 30 天)
显示 更早的评论
Thank you in advance.
I tried to load a C library (as enclosed) into matlab and got an error 'dll is not a valid Win32 application' as follows. May ask what is the issue and how can I resolve it ?
% load SDK
addpath(fullfile(matlabroot,'extern','ifmO3D'))
if not(libisloaded('pmdaccess2'))
loadlibrary('pmdaccess2','pmdsdk2common.h','addheader','pmddatadescription.h','addheader','pmdsdk2.h')
end
libfunctions('pmdaccess2')
.............Error ...........................
In loadlibrary
In ifm_O3D_Interface (line 8)
Error using loadlibrary
There was an error loading the library "C:\Program Files\MATLAB\R2016a\extern\ifmO3D\pmdaccess2.dll"
C:\Program Files\MATLAB\R2016a\extern\ifmO3D\pmdaccess2.dll is not a valid Win32 application.
Error in ifm_O3D_Interface (line 8)
loadlibrary('pmdaccess2','pmdsdk2common.h','addheader','pmddatadescription.h','addheader','pmdsdk2.h')
Caused by:
Error using loaddefinedlibrary
C:\Program Files\MATLAB\R2016a\extern\ifmO3D\pmdaccess2.dll is not a valid Win32 application.
0 个评论
回答(1 个)
Pico Technology
2016-10-12
Hi Seungkook,
Is the dll that you are attempting to load a 64-bit version? If not this is likely to be the issue as MATLAB 2016a is only available as a 64-bit version.
mex -setup
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 C Shared Library Integration 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!