Mex a cpp file in MATLAB, but cannot find .h files, ubuntu 14.04
Mostrar comentarios más antiguos
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
el 27 de Jul. de 2015
0 votos
You need to find those header files. When you do, simply put them in the current directory where the cpp file is.
1 comentario
paralysis
el 27 de Jul. de 2015
Walter Roberson
el 27 de Jul. de 2015
0 votos
Those are Microsoft headers; see http://www.viva64.com/en/b/0265/ and http://stackoverflow.com/questions/6193607/cannot-find-direct-h
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.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!