Hello,
I have been trying to load a 64-bit library (.dll) using the command "loadlibrary" on Matlab 64-bit, but I always receive the following error:
Error using loadlibrary (line 418) C:\Users\****\AppData\Local\Temp\tpe7fb8e10_222c_47c3_ad59_ab00161c9411\shrlibsample_thunk_pcwin64.dll is not a valid Win32 application.
As you may see, the library I am attempting to load is the shrlibsample, using the following commands:
>> addpath(fullfile(matlabroot,'extern','examples','shrlib')) >> loadlibrary('shrlibsample','shrlibsample.h')
And I also have Microsoft Software Development Kit (SDK) 7.1 set as compiler for Matlab (mbuild -setup).
I have already read several questions related to this issue, but I did not find any similar to the problem I am facing: I am trying to load a 64-bit library on a 64-bit Matlab and the error reported by the latter is related to an expectation of loading a 32-bit library, what does not make sense to me.
Some additional info: I also have Matlab 32-bit installed on my computer (Win7 64-bit), which also makes use of SDK 7.1 as compiler and I am able to load any (32-bit) library on that Matlab.
Any ideas or suggestions are very much appreciated.
Thanks, Guilherme
Best Answer