Mex a cpp file in MATLAB, but cannot find .h files, ubuntu 14.04

Hello, All,
I'm new to mex and trying to rebuild a c++ program with MATLAB interface in my machine. In the cpp file, it has stdafx.h, io.h, direct.h, etc inside. but when I run
mex thefile.cpp
It has
6:20: fatal error: direct.h: No such file or directory
#include <direct.h>
error shown. Here because the file direct.h is the first one, the system just shows this error and terminated. When I tried other .h files as the first one to be included, the system shows the exactly same error except for the header file name.
I don't quite know where those .h files located or even I have it. And I don't know where it should be copied to and how.
Hope someone could help me with that. Thanks!

Respuestas (2)

James Tursa
James Tursa el 27 de Jul. de 2015
You need to find those header files. When you do, simply put them in the current directory where the cpp file is.

1 comentario

Thanks! But where can I find those header files? The problem is, I can find the header files of a same name in different directories. No idea which directory should be the right one in ubuntu 14.04.

Iniciar sesión para comentar.

Walter Roberson
Walter Roberson el 27 de Jul. de 2015
As you are using Ubuntu those include files do not apply. You will likely need to edit the code to call POSIX routines instead of Microsoft routines. http://pubs.opengroup.org/onlinepubs/007908775/xsh/dirent.h.html

Categorías

Más información sobre MATLAB Compiler en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 27 de Jul. de 2015

Respondida:

el 27 de Jul. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by