0

I have a file named call_mat.cpp with two statements at its beginning:

\#include "MatlabDataArray.hpp" and    \#include "MatlabEngine.hpp"

These headers files are not on "gcc" default search path. They are in the folder "C:/Programmes/MATLAB/R2018a/extern/include". I tried the "-I" option to include them when running my code using the following command:

gcc -c -I/C:/Programmes/MATLAB/R2018a/extern/include call_mat.cpp

I get the following error:

call_mat.cpp:1:10: fatal error: MatlabDataArray.hpp: No such file or directory
    1 | #include "MatlabDataArray.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Adriaan
  • 17,741
  • 7
  • 42
  • 75

1 Answers1

0

Are you doing this under MSYS2 shell? If so, you should either use:

-IC:/Programmes/MATLAB/R2018a/extern/include

or:

-I/C/Programmes/MATLAB/R2018a/extern/include

or maybe even:

-I'C:\Programmes\MATLAB\R2018a\extern\include'

If you're not using any kind of *nix-like shell (or the plain Command Prompt or PowerShell) you can probably use:

-I "C:\Programmes\MATLAB\R2018a\extern\include"
Brecht Sanders
  • 6,215
  • 1
  • 16
  • 40