Unable to load dll using loadlibrary

7 views (last 30 days)
Hi, I am using MATLAB 2012a (64 bit installation) on a 64 bit Windows XP platform. I need to use a 32 bit dll (compiled using MS VC 2010) through MATLAB for controlling several devices. This dll is depends on another 32 bit dll. However the compiled dll has 64 bit dependencies so that it works on the 64 bit Windows platform. I get the following error when I try to use loadlibrary:
Error using loadlibrary (line 419) There was an error loading the library "<PATH>\MATLAB\dllname.dll" PATH\MATLAB\dllname.dll is not a valid Win32 application.
I cannot create a 64 bit dll for my application since the device vendor has provided a 32 bit dll.
I wanted to know if any workaround exists so that I can load the 32 bit dll(with 64 bit dependencies) into MATLAB using loadlibrary.

Accepted Answer

Philip Borghesani
Philip Borghesani on 29 Jun 2012
You will need to install 32 bit MATLAB on your machine. That is the only way to use a 32 bit dll.

More Answers (1)

prashanth
prashanth on 5 Jul 2012
Thanks. Installed the 32 bit version and it works.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!