필터 지우기
필터 지우기

Undefined reference to mxGetDoubles when building wrapper DLL

조회 수: 5 (최근 30일)
John Harland
John Harland 2023년 4월 25일
답변: Prathamesh 2023년 8월 17일
I have a MATLAB script compiled into a DLL using mcc. I've created a wrapper library to allow me to call a function using C native types (my intention is to produce a DLL that can be imported into LabVIEW). On attempting to build it with mbuild I get errors indicating that mxGetDoubles and mxSetDoubles, which I'd used in the wrapper function, are undefined.

답변 (1개)

Prathamesh
Prathamesh 2023년 8월 17일
Hi,
I understand that you are encountering an error message stating “mxGetDoubles and mxSetDoubles are undefined”.
Refer to pointers below to resolve the issue:
  1. This error message usually occurs when the linker cannot find the library that contains the function definition.
  2. This error can occur when you are using a version of MATLAB that is not compatible with C/C++ compiler version.
  3. Try to resolve this issue by checking if you are using the correct version of the C/C++ compiler that is compatible with your MATLAB version. Refer to the link to check the version compatibility and installation steps.
4. Also, ensure that the header declarations for these functions are done properly.
5. Those functions are for the R2018a memory model API. For that, you need to add the -R2018a option flag.
mex myfile.cpp -R2018a.
Refer to the documentation links for these functions to get more information.

카테고리

Help CenterFile Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by