This error may occur only with MATLAB Compiler 4.8 (R2008a) or later versions because of changes that have been introduced in mclmcrrt.h and mclmcr.h, which impose the requirement that mclmcr.h always be included after mclmcrrt.h for the pre-processing stage.
In the attached driver application, the following code is found on Lines 1-2:
#include "mclcppclass.h"
#include "Test.h"
Here, mclcppclass.h (found in the <matlabroot>/extern/include directory) in turn includes mclmcr.h.
Also, in the generated Test.h file, the following code can be found:
#include "mclmcrrt.h"
#include "mclcppclass.h"
This results in mclcppclass.h being included before mclmcrrt.h, thus causing a symbol resolution issue for the identifiers mclInitializeApplication_proxy and mclmcrInitialize_proxy.
In order to resolve this issue, change the order of the header files in mydriver.cpp to the following:
#include "Test.h"
#include "mclcppclass.h"
Also, since Test.h already includes mclcppclass.h, you can entirely avoid including this header file in your driver application.
Best Answer