Compiling a c++ code in MATLAB R2016a

4 views (last 30 days)
Deepashree Gurumurthy
Deepashree Gurumurthy on 3 Nov 2016
Commented: James Tursa on 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 !

Answers (0)

Categories

Find more on Write C Functions Callable from MATLAB (MEX Files) in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!