2

i'm tring to create a .dll file from this .c code (for Labview). http://www.mathworks.com/matlabcentral/fileexchange/26190-vchoosek

But i'm not able to compile it nor with VisualStudio nor with "mcc" because both compilers return this error:

VChooseK.obj : error LNK2019: unresolved external symbol mexErrMsgIdAndTxt referenced in function BadInputTypeError 
VChooseK.obj : error LNK2019: unresolved external symbol mxFree referenced in function ElemK_8Byte 
VChooseK.obj : error LNK2019: unresolved external symbol mxMalloc referenced in function ElemK_8Byte 
VChooseK.obj : error LNK2019: unresolved external symbol mxGetData referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxGetPr referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxGetElementSize referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mexWarnMsgIdAndTxt referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxCreateNumericMatrix_730 referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxGetClassID referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxSetN_730 referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxSetM_730 referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxDuplicateArray referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxGetScalar referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxGetNumberOfElements referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxIsDouble referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxIsLogical referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxIsChar referenced in function mexFunction 
VChooseK.obj : error LNK2019: unresolved external symbol mxIsNumeric referenced in function mexFunction 

Someone could help me? I've already include the path of "mex.h" in VisualStudio

Pietro Z.
  • 521
  • 2
  • 6
  • 18

1 Answers1

0

You must include the important libraries for linking. The libraries like libmex.lib;libmat.lib;libmx.lib and others if needed. If you are using the MATLAB 2018b, the include path must include "C:\Program Files\MATLAB\R2018b\extern\include" and Library Path "C:\Program Files\MATLAB\R2018b\extern\lib\win64\microsoft".

  • The error message is for linking issue. Check matlabroot for the Matlab installation folder. matlabroot will return 'C:\Program Files\MATLAB\R2018b'. You can find include folder inside "C:\Program Files\MATLAB\R2018b\extern" and Library files inside "C:\Program Files\MATLAB\R2018b\extern\lib\win64\microsoft". – Pramod Kumar Apr 26 '22 at 18:46