Compiling a c++ code in MATLAB R2016a

조회 수: 5 (최근 30일)
Deepashree Gurumurthy
Deepashree Gurumurthy 2016년 11월 3일
댓글: James Tursa 2016년 11월 3일
I am trying to compile a C++ program on MATLAB R2016a on Windows 10. I have worked on other C files in the same version of MATLAB and OS successfully before.
I have completed the 'mex -setup' and also changed the compiler to 'Microsoft Visual C++ 2015 Professional', and changed current directory and the path to the folder which contains this file . Also, as per suggestions on related topics on MATLAB Answers , I tried using addpath() and changing environment variables to the matlabroot folder as well .
I still encounter the same error which says file not found or check spelling , as shown below.
>> mex segment.cpp
Error using mex C:\Users\...\segment.cpp not found; check that you are in the correct current folder, and check the spelling of 'C:\Users\...\segment.cpp'.
I have checked the spelling and tried exist('segment.cpp') which returned 2 , but I might be missing something very simple here .
Can anyone please help me out with this?
Thanks in advance !

답변 (0개)

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by