MATLAB: Does the standalone application not load a shared library built using the MATLAB Compiler

2003corruptdllerrorfatalfileinvalidlcclibrarylnk1136loadMATLAB Compilermsvc

I use the following MCC command to build a shared library using the MATLAB Compiler:
mcc -C -G -W lib:MCCviewerClient -T link:lib client_multical360.m client_feature_list_export.m get_feature_data.m handle_external_request.m
where, the last four parameters are the interfaces I want to make available to an external application.
I then create a standalone application using the Microsoft Visual Studio .NET 2003 IDE that implicitly links against the MATLAB Compiler generated library. However, when this application is executed, the library generated by the MATLAB Compiler is not loaded into the process.

Best Answer

This change has been incorporated into the documentation in Release 2011a (R2011a). For previous releases, read below for any additional information:
This issue is caused by an incompatibility between the import libraries of different compilers.
The MATLAB Compiler generated shared library was built using the LCC compiler, while the standalone application uses the Microsoft Visual Studio .NET 2003 compiler.
There are two possible workarounds to this issue:
1. Use the same compiler to create the shared library, and to compile/link the standalone application.
2. If there is a need to use different compilers in the different stages, then compiler-specific tools can be used to generate import libraries for other compilers.
For instance, LCC provides a tool called lcc_implib.exe in the MATLABROOT\sys\lcc\bin folder, where MATLABROOT is the output of typing the following command at the MATLAB prompt:
matlabroot
This tool can generate an LCC-compatible import library for a DLL built with any compiler.