Compiler error when running Simulink models from Visual Studio

I have compiled all subsystems of a big, complex, Simulink model into a series of dlls. All of them are working in Visual Studio except one. The one that is not working is the only one that requires the simstruc.h header file, and I get about 120 error messages when I try to compile them. Most of them are in simstruc.h, but also in subsequent includes, like sfcn_bridge.h for example. All of them look the same way:

error C2143: syntax error : missing ';' before '*' c:\matlabr2011b_x86\rtw\c\src\sfcn_bridge.h (37) 
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\matlabr2011b_x86\rtw\c\src\sfcn_bridge.h (37)

.

error C2143: syntax error : missing ';' before '*' c:\matlabr2011b_x86\simulink\include\simstruc.h (2135) 
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\matlabr2011b_x86\simulink\include\simstruc.h (2135)

The code in the line in above example looks like this:

sfcn_bridge.h (37):

SS_SimMode *simModePtr;

simstruc.h (2135):

SparseHeader* slvrJacobianMatrix;

I have been able to compile programs that include simstruc.h before, but suddenly it's not working. Can anyone point me in the right direction?

Answers


Check if any of your class declaration missing ";" at the end.

class AAA
{
}; <--- this one

Edit:

Try these tips as well.

  • Rebuild the project
  • Right Click on each cpp file and click "Compile" to identify infected files.
  • Check include paths. specially sub folders in simulink include directory.
  • Go to the declaration of SparseHeader struct and check if it get skipped by any #ifdefs or any preprocessor definitions.
  • If your code base is small, comment out half of it until you get a compilable code. This is not easy however.

Need Your Help

OpenGL FBO - White pixels appear transparent

c++ opengl 2d alphablending fbo

I'm making a 2D game using OpenGL. I recently tried implementing Framebuffer-objects, and I am having some problems regarding blending.

Git asks a password for a wrong URL

git github repository

After creating a repository at GitHub, I follow the instruction given by GitHub: