Is it possible to mex a .cpp include lots of .h file provide by mathworks.
2 次查看(过去 30 天)
显示 更早的评论
I want to mex a .cpp file, however, the .cpp file include a .h file (Refer as 1.h) provided by mathworks, 1.h include another .h file (Refer as 2.h) provided by mathworks, as a result, there are lots of .h file from mathworks are included. When call mex, it will return an error due to there is some .h file by mathworks not found. I wonder if it's possible to mex file without find and copy all .h files into one files?
1 个评论
James Tursa
2017-11-22
编辑:James Tursa
2017-11-22
This happens all the time in the normal course of mexing files. E.g., having
#include "mex.h"
will include that file, and inside that file is this line
#include "matrix.h"
So just doing regular mexing already does what you apparently are having problems with ... it includes an additional file that you didn't explicitly specify.
Can you give more details as to how you are doing your compiling, and what exactly are the includes that you have in your code?
回答(3 个)
Walter Roberson
2017-11-21
"I wonder if it's possible to mex file without find and copy all .h files into one files"
No.
xian zhao
2017-11-29
1 个评论
Kuber Dwivedi
2024-6-7
Hello Xian,
I'm encountering the same error message: "undefined reference to `mdlInitialize_CAN_datatype(SimStruct_tag*)'". Could you please assist me with creating a Mex function using Microsoft Visual Studio?
Thank you for your help
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!