Error including custom header files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-04 11:30 AM
Hi
I am trying to include a custom Header file "LCD1602.h" along with its source file "LCD1602.c" in my project. I have also added the respective path in Project>Properties>C/C++ General>Paths and symbols. But when I build the project, the macros declared in the LCD1602.h seem to be unknown to the LCD160.c file. One of the error can be seen in the below image.
I am not able to figure out where the problem exactly lies.
Is there any issue with the hierarcy of folders? Cause I planned to follow the same structure for other components as well.
Also, I noticed that the icons of my custom .h and .c files are different from that of main.c and main.h
- Labels:
-
LCD-LTDC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-04 12:33 PM
An error analysis should start with the very first error. Is LCD1602.h included in LCD1602.c? Check also the console view output for resulting compiler options and try to understand what happened.
hth
KnarfB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-04 05:29 PM
There's something strange in the project explorer view on the top picture: what is the upper folder with name containing slashes?
Try to roll back your changes in the project and add the include path again, this time properly.
Use only the paths and symbols dialog, not drag and drop.
-- pa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-05 07:06 AM
The folder that you marked with a ? appeared automatically. I didn't create that. Is there any problem with the hierarchy I have chosen for the header and source files LCD1602 ? (ignoring that ? marked folder. I have deleted that)
The folder appears automatically whenever I Build the project.
I have also done: Project>Properties> C/C++ General> Paths and symbols>Include tab>Add, Checked the "Folder is a Workspace path", selected the Inc folder inside HubComponents folder. Still getting the below error. Further added the src folder in the Source folder tab.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-05 07:10 AM
I forgot to include that in the source file. Thank you Sir.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-05 08:25 AM
Well, Eclipse can be hard to tame. But this should not bar you from making progress.
Move LCD1602.h to Src (same directory where LCD1602.c is) and continue working on the project.
Sort it down later.
-- pa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-02-05 09:34 AM
The project built successfully but I had to place the lcd .h and .c files in the same folders as main.h and main.c
This resolved the issue but still I was unable to place my custom .h and .c files in separate hierarchical directories.