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!

回答 (1 件)

James Tursa
James Tursa 2015 年 6 月 29 日
編集済み: James Tursa 2015 年 6 月 29 日

0 投票

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

カテゴリ

ヘルプ センター および File ExchangeWrite C Functions Callable from MATLAB (MEX Files) についてさらに検索

質問済み:

2015 年 6 月 29 日

編集済み:

2015 年 6 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by