MATLAB: [Matlab coder] error LNK2001: unresolved external symbol _bwdistEDT_tbb_boolean

bwdistImage Processing Toolboxmatlab coder

Hi Sir,
From Matlab coder I got a piece of C++ code that implement bwdist() function as below :
static void bwdist(const boolean_T *varargin_1, float *varargout_1, const int ROI_img_w_2, const int ROI_img_h_2)
{
//boolean_T BW[25920];
boolean_T *BW = (boolean_T *)calloc(ROI_img_h_2*ROI_img_w_2,sizeof(boolean_T));
double dv2[2];
memcpy(&BW[0], &varargin_1[0], ROI_img_h_2 * ROI_img_w_2 * sizeof(boolean_T));
dv2[0] = ROI_img_h_2;
dv2[1] = ROI_img_w_2;
bwdistEDT_tbb_boolean(BW, dv2, 2.0, varargout_1);
b_sqrt(varargout_1);
}
But when I build the project I got a link error as below :
Error 37 error LNK2001: unresolved external symbol _bwdistEDT_tbb_boolean 3DModeDlg.obj hfuapp
If I mark out the line "bwdistEDT_tbb_boolean(BW, dv2, 2.0, varargout_1);" of the above codes the error is gone, then I found the symbol seems to be declared in "libmwbwdistEDT_tbb.h" as below :
EXTERN_C LIBMWBWDISTEDT_TBB_API
void bwdistEDT_tbb_boolean(const boolean_T* bw, /** Pointer to bw image */
const real64_T* input_size, /** Pointer to bw image size */
const real64_T num_dims, /** Number of dimensions in image */
real32_T* d); /** Output - distance to nearest non-zero pixel */
From my understanding, I will need a library(*.lib) file that defines "bwdistEDT_tbb_boolean" included in my project, but I do not know where the file is, appreciaed for your help, thanks.

Best Answer

Hi Sir,
Thanks for reply.
By the way, I just found the library, it's located at (depending on the compiler used):
C:\Program files\MATLAB\R2018b\extern\lib\win64\microsoft
C:\Program files\MATLAB\R2018b\extern\lib\win64\mingw64
The *.lib file that contains the definition of "bwdistEDT_tbb_boolean" is libmwbwdistEDT_tbb.lib.