Compiling a c++ code in MATLAB R2016a

3 visualizaciones (últimos 30 días)
Deepashree Gurumurthy
Deepashree Gurumurthy el 3 de Nov. de 2016
Comentada: James Tursa el 3 de Nov. de 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 !

Respuestas (0)

Categorías

Más información sobre Write C Functions Callable from MATLAB (MEX Files) en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by