Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Problem with adding a new file.h (The compiler can,t find the file.h that i created)
Problem with adding a new file.h [message #1803768] Fri, 08 March 2019 18:44 Go to next message
da ru is currently offline da ruFriend
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 #1803769 is a reply to message #1803768] Fri, 08 March 2019 19:21 Go to previous messageGo to next message
da ru is currently offline da ruFriend
Messages: 6
Registered: February 2019
Junior Member
Sorry finnaly i can find here -> https://www.eclipse.org/forums/index.php/m/1778948/?srch=add+.h+library#msg_1778948
Re: Problem with adding a new file.h [message #1803772 is a reply to message #1803769] Sat, 09 March 2019 01:23 Go to previous message
David VavraFriend
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.
Previous Topic:install intel toolchain plugin from remote host
Next Topic:Most useful c++ snippets of code
Goto Forum:
  


Current Time: Thu Apr 25 07:46:01 GMT 2024

Powered by FUDForum. Page generated in 0.02882 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top