Using mex: Cannot open include file: 'levmar.h': No such file or directory

I am still learning how to use the mex command and I have a file called levmar.c which has #include levmar.h
I type in the command prompt
mex levmar.c
and the following text appears
Building with 'Microsoft Visual C++ 2012 (C)'.
Error using mex
levmar.c
C:\Users\Alex\Documents\levmar-2.6\levmar-2.6\matlab\levmar.c(27)
: fatal error C1083: Cannot open include file:
'levmar.h': No such file or directory
I have levmar.h in the working directory, so I don't know why I would be getting this error unless all include files have to be in a special directory. Using the option to specify the pathname for include files I typed the following into the command prompt:
>> mex levmar.c -I<C:\Users\Alex\Documents\levmar-2.6\levmar-2.6\matlab>
And the following was the result:
Building with 'Microsoft Visual C++ 2012 (C)'.
Error using mex
Access is denied.
Does anyone know why this could be happening? Thank you in advance!

Antworten (1)

James Tursa
James Tursa am 29 Jun. 2015
Bearbeitet: James Tursa am 29 Jun. 2015

0 Stimmen

levmar.h needs to be in the current directory. Try copying it there.

Kategorien

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

Gefragt:

am 29 Jun. 2015

Bearbeitet:

am 29 Jun. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by