error LNK2019: unresolved external symbol emlrtReturnArrays

6 ビュー (過去 30 日間)
Ion Iturbe
Ion Iturbe 2017 年 2 月 10 日
コメント済み: Hao Ren 2018 年 5 月 9 日
Hello,
I'm generating C code from Matlab function.
I would like to test generated C code in Matlab, using a C mex function. I've seen that while generating code, an "interface" folder is also generated inside the "codegen" folder, so I tried to compile the mex function inside "codegen/interface/_coder_MyFunctionName_mex.c" file.
But I'm getting the "unresolved external symbol" error for allmost all the "emlrtXXX" functions.
Am I doing something wrong?
Regards,
Ion

回答 (1 件)

Michelle Wu
Michelle Wu 2017 年 2 月 17 日
The MATLAB Answers post attached below looks relevant to the error you saw:
The error looks like a linker related issue. You probably need to include all the necessary source files to the MEX command and compile them together.
  2 件のコメント
Ion Iturbe
Ion Iturbe 2017 年 2 月 20 日
Hi,
Thank you for your answer but it doesn’t solve my problem.
I’m trying including different c files in mex command and so on, but I'm getting to some limits. I think we should look at this issue in two differents part:
1- Which is the exact mex command to use to generate mex function from a code generated by ecoder? It should be nice for everybody to have this command, I think.
2- I get to "unresolved external symbol" for "emlrtReturnArrays", "emlrtErrMsgIdAndTxt", and more "emlrt*" functions. This functions are declared in "emlrt.h" that I found in "C:\Program Files\MATLAB\R2016b\extern\include" but it looks like while linking they are not found. How can this problem be solved?
Regards,
Ion
Hao Ren
Hao Ren 2018 年 5 月 9 日
is it solved?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB Code Analysis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by