matlabdll32bit-64bitincompatibilitylibfaac

libfaad2.dll is not a valid win32 application - dependency error kernel32.dll


Win7 Service Pack 1 Matlab 2013b

Hello

I am trying to include a libfaad2.dll lib (which I got ready compiled) to Matlab so I can use the functions. I try this with the loadlibrary command. But I get the error message libfaad.dll is not a valid win32 application! from matlab.

A short examination of libfaad2.dll with DependencyWalker (x64 Version) showed that it needs c:\windows\system32\Kernel32.dll. But there is also shown that 2 functions are not available in kernel32.dll

---> So I guess this is not a Matlab Problem

BUT the c:\windows\sysWow64\kernel32.dll includes the desired functions!

How can I tell matlab, or generally, that the libfaad2.dll file should use the sysWow64\kernel32.dll ?


Solution

  • Found a solution: Installing 32 bit version of Matlab and try with this. Worked at first try!

    More detailed: Win7 has 2 different folders for system .dlls

    C:\windows\system32: Here are all the .dlls for 64-bit software and not for 32!

    C:\windows\SysWoW64: WoW64 stands for "Windows on 64-bit Windows", and it contains all the 32-bit binary files required for compatibility, which run on top of the 64 bit Windows.

    Using 32-bit version, Matlab will use the SysWoW64 files. And that is the rigth kernel32.dll which contains all the functions needed!