Problem with adding a new file.h [message #1803768] |
Fri, 08 March 2019 18:44 |
da ru Messages: 6 Registered: February 2019 |
Junior Member |
|
|
Hi folks ,
i have a new problem , i try to do modular programming with C , i did a new file.h , and i
reference to it in mi file.c in this form #include<file.h> , but the compiler didn,t find ,
I try to put with the others .h that are in the foulders C:/MinGW/ ... , but eclipse don,t let me , what i have to do ? thanks
-
Attachment: Captura.PNG
(Size: 83.73KB, Downloaded 83 times)
|
|
|
|
Re: Problem with adding a new file.h [message #1803772 is a reply to message #1803769] |
Sat, 09 March 2019 01:23 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
Not clear if that helped.
You need to pay attention to where you put the header file and how you reference it.
1) there is a difference between
#include <file.h> and
#include "file.h"
as explained here https://developerinsider.co/what-is-the-difference-between-include-filename-and-include-filename/
#include "file.h" will search the directory containing the source file with the include statement then the system include directories list.
2) you can add to the system include path list with the -I<dir> option.
3) your header file is in the top level of your project directory and it looks like you intended it to be include
In any case, it's not where the source file is so you need to add a -I<dir> where <dir> is where the header actually is.
|
|
|
Powered by
FUDForum. Page generated in 0.02882 seconds