title: error: expected constructor, destructor, or type conversion before '(' token?
body: <p>I'm trying to compile a cpp file using mex (changeanalysis.cpp). I have Matlab R2012a, Xcode 4.6 on a MAC OS X 10.7. In the file changeanalysis.cpp, aef_global_dllexport.h is included. Some part of aef_global_dllexport.h is as follows:</p>
  
  <pre><code>    ////////////////////////
      // DLL EXPORT FUNCTIONS
      ////////////////////////
      #define DLLEXPORT _declspec(dllexport)
  
  
      DLLEXPORT double maha_dist_3D_ex(   double          x,
                                          double          y,
                                          double          z,
                                          double*         mean,
                                          double**        icovm);
  
      DLLEXPORT int matrix_inv_ND_ex(     double**        matND,
                                          double&amp;         det,
                                          int             Dim);
  
      DLLEXPORT int matrix_copy3x3_ex(    double**        x, 
                                          double**        y);
      .
      .
      .
  </code></pre>
  
  <p>When I compile the file changeanalysis.cpp, I get  the following error message at the command prompt:</p>
  
  <blockquote>
    <p>mex -I"/Users/marzi/Documents/MATLAB" changeanalysis.cpp</p>
    
    <p>In file included from changeanalysis.cpp:58:</p>
    
    <p>/Users/marzi/Documents/MATLAB/aef_global_dllexport.h:7: error:
    expected constructor, destructor, or type conversion before '(' token</p>
    
    <p>/Users/marzi/Documents/MATLAB/aef_global_dllexport.h:13: error:
    expected constructor, destructor, or type conversion before '(' token</p>
    
    <p>/Users/marzi/Documents/MATLAB/aef_global_dllexport.h:17: error:
    expected constructor, destructor, or type conversion before '(' token</p>
    
    <p>/Users/marzi/Documents/MATLAB/aef_global_dllexport.h:20: error:
    expected constructor, destructor, or type conversion before '(' token</p>
    
    <p>/Users/marzi/Documents/MATLAB/aef_global_dllexport.h:22: error:
    expected constructor, destructor, or type conversion before '(' token</p>
    
    <p>/Users/marzi/Documents/MATLAB/aef_global_dllexport.h:24: error:
    expected constructor, destructor, or type conversion before '(' token</p>
    
    <p>/Users/marzi/Documents/MATLAB/aef_global_dllexport.h:29: error:
    expected constructor, destructor, or type conversion before '(' token</p>
    
    <p>/Users/marzi/Documents/MATLAB/aef_global_dllexport.h:31: error:
    expected constructor, destructor, or type conversion before '(' token</p>
    
    <p>/Users/marzi/Documents/MATLAB/aef_global_dllexport.h:50: error:
    expected constructor, destructor, or type conversion before '(' token</p>
    
    <p>/Users/marzi/Documents/MATLAB/aef_global_dllexport.h:75: error:
    expected constructor, destructor, or type conversion before '(' token
    /Users/marzi/Documents/MATLAB/aef_global_dllexport.h:100: error:
    expected constructor, destructor, or type conversion before '(' token</p>
    
    <p>mex: compile of ' "changeanalysis.cpp"' failed.</p>
    
    <p>Error using mex (line 206) Unable to complete successfully.</p>
  </blockquote>
  
  <p>Does anyone know how to fix this or what is the cause of this error? </p>
  
  <p>Thanks.</p>