Load C/C++ shared library into MATLAB - '.dll is not a valid Win32 application'
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Pico Technology
el 12 de Oct. de 2016
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 comentarios
Ver también
Categorías
Más información sobre C Shared Library Integration en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!