Compiling a c++ code in MATLAB R2016a

1 Ansicht (letzte 30 Tage)
Deepashree Gurumurthy
Deepashree Gurumurthy am 3 Nov. 2016
Kommentiert: James Tursa am 3 Nov. 2016
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 !

Antworten (0)

Kategorien

Mehr zu Write C Functions Callable from MATLAB (MEX Files) finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by