title: Error detected from emxArray_uint8_T: .text+0xc1): undefined reference to `emxInit_uint8_T1(emxArray_uint8_T**, int)'?
body: <p>I write a matlab function that calculates entropy of gray scale image: "score=score_entropy(image)" then use matlab coder to convert it to c++</p>
  
  <p>c++ code:
  <pre></p>
  
  <pre><code>#include "mex.h"
  #include "math.h"
  #include "score_entropy.cpp"
  #include"score_entropy_emxAPI.cpp"
  
  class image
  {
  public: 
  unsigned char *im;
  int h1,w1;
  voide scoreimage();
  }
  void image::scoreimage( )
  { emxArray_uint8_T* I=emxCreateWrapper_uint8_T(im,h1,w1);
  double ent=score_entropy(I);
   emxDestroyArray_uint8_T(I);
  }
  void mexFunction( int nl, mxArray *pl[], int nr, const mxArray *pr[] )
  {
  image.im = ( unsigned char*) mxGetData(pr[0]);
  image. h1 = (int) imgSize[0];
   image. w1 = (int) imgSize[1];
  image.scoreimage();
  }
  </code></pre>
  
  <p>The definition of score_entropy.cpp :
  double score_entropy( const emxArray_uint8_T *im)</p>
  
  <p>I found a list of errors :</p>
  
  <code>(.text+0xc1): undefined reference to `emxInit_uint8_T1(emxArray_uint8_T**, int)'
  (.text+0xfb): undefined reference to `emxEnsureCapacity_uint8_T(emxArray_uint8_T*, int)'
  (.text+0x16c):undefined reference to `emxInit_uint8_T(emxArray_uint8_T**, int)'
  ..
  ..
  (.rdata$.refptr.rtMinusInf[.refptr.rtMinusInf]+0x0):
  undefined reference to `rtMinusInf'
  collect2.exe: error: ld returned 1 exit status
  </code></pre>
  
  <p>can any one help to correct this code?</p>