Is it possible to mex a .cpp include lots of .h file provide by mathworks.

조회 수: 1 (최근 30일)
xian zhao
xian zhao 2017년 11월 21일
답변: xian zhao 2017년 11월 29일
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
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
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.
  댓글 수: 8
xian zhao
xian zhao 2017년 11월 23일
yes,I already implement your suggestion,also the file are copied to the same one fold. still there is the same error. i will share my code soon for your convenient to evaluate.
xian zhao
xian zhao 2017년 11월 23일
Please find my code from below link. Thanks.

댓글을 달려면 로그인하십시오.


xian zhao
xian zhao 2017년 11월 23일
Please find the code and other files related.

xian zhao
xian zhao 2017년 11월 29일
I get the solution, I mex my code with MinGW before. However it's not compatilbe with .lib generated by microsoft VS. And when I try mex with microsoft visual studio, the mex proceed successfully.

카테고리

Help CenterFile Exchange에서 C MEX 文件应用程序에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!