MATLAB: Do the MEX-files, that were created with MATLAB 5.3.x, no longer run in MATLAB 6.0 (R12)

MATLABmexmsvcr12

When running older MEX-files in MATLAB 6.0, I get errors regarding unresolved external symbol mexFunction. I tried rebuilding the code with the new versions of MATLAB and the Compiler within Microsoft Visual Studio 6.0 and get the following errors:
Test.def : error LNK2001: unresolved external symbol mexFunction
Release/Test.lib : fatal error LNK1120: 1 unresolved externals
LINK : fatal error LNK1141: failure during build of exports file
Error executing link.exe.
The .def file contains the following:
LIBRARY Test.dll
EXPORTS mexFunction
The MEX, C and h files and stubs were built using:
mcc -t -L C -W mex Test.m
The following 2 pre-link steps are included in the project settings:
lib /def:"d:\matlabr11\extern\include\matlab.def" /machine:ix86/out:"Release\mymatlab.lib"
lib /def:"d:\matlabr11\extern\include\libmatlbmx.def" machine:ix86/out:"Release\mylibmatlbmx.lib"
These generated lib files are then linked into the project.
All of this is still the same as for R11: I only changed my paths from
"MatlabR11" to "MatlabR12"…

Best Answer

This problem occurs because we have changed the name of the exported symbol in compiler-generated MEX-files to be "mexLibrary". Please change any MSVC projects that build MEX-files to replace the .def file with one that exports mexLibrary instead of mexFunction.
You will need to change the name of the exported symbol in the .def file to be:
mexLibrary
instead of:
mexFunction
Related Question