Help in telling compiler to include header files for C

  • #26
259
786
This one
>gcc einterp_mex.c -LC:\Users\atrch\Documents\MATLAB\geos\mvep2\mutils-0.4\mutils\libutils
Since that is the command you are using, assuming the header files are located in that folder, try this:
Code:
gcc einterp_mex.c -IC:\Users\atrch\Documents\MATLAB\geos\mvep2\mutils-0.4\mutils\libutils
Note that it is a capital i (I). Not a lower case L. I write the note because some fonts make them look very similar.

Also, if you are 100% sure that all those third party headers provided are included with #include "file" and not #include <file>, you can be even more specific and use:
Code:
gcc einterp_mex.c -iquoteC:\Users\atrch\Documents\MATLAB\geos\mvep2\mutils-0.4\mutils\libutils
gcc -Ldir -- Here dir is the full path where your include files are.
A little correction in case anyone wants to know the actual use :smile:, -Ldir is actually used for the subprogram ld for linking, not header includes. I say it because the referenced documents doesn't explicitly say it.
 
  • #27
33,169
4,853
A little correction in case anyone wants to know the actual use :smile:, -Ldir is actually used for the subprogram ld for linking, not header includes. I say it because the referenced documents doesn't explicitly say it.
OK, that makes sense that -L would be used for library files, not include files.
 
  • #28
jtbell
Mentor
15,501
3,296
Right,

-Idirectory (uppercase letter "eye") specifies where to look for include-files when compiling;

-Ldirectory specifies where to look for previously-compiled libraries when linking.
 

Related Threads for: Help in telling compiler to include header files for C

Replies
3
Views
2K
Replies
1
Views
2K
  • Last Post
Replies
11
Views
3K
Replies
5
Views
1K
  • Last Post
Replies
5
Views
13K
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
22
Views
4K
Replies
2
Views
2K
Top