Hey folks,
I’m running into problems with System Include, aka Angled bracket includes. in Eclipse 2.3 using GCC 4.1.0. I figured I’d throw this out there in case someone else has encountered and fixed this issue.
Details:
Running Eclipse 2.3 using GCC 4.1.0, as installed, setup, and patched by the (awsome) sdk4arm from amontec.com Running on Windows XP. Using Eclipse “Build Automaticlly” build option.
Problem Details:
System includes (aka angle-bracket includes) are not working. Simple example: If I include <string.h> in main.c, I receive the error “main.c:29:49: error: string.h: No such file or directory.”
Fixes that Didn’t work:
- I went to “Projects | Properties” and in “Include Paths & Symbols” added the directory* containing the file by hand. It did not work.
- D:\Program Files\amontec\sdk4arm\gat\garm\arm-elf\include
-
I tried changing from <string.h> to a complete path to the exact file. That works but it’s not an acceptable solution for large projects like FreeRTOS, which would require converting many files.
-
I tried changing the include to “string.h” and doing #1 at the same time. That works but it’s not an acceptable solution for large projects like FreeRTOS, which would require converting many files.
This is hardware-agnostic. I believe it has something to do with gcc, and how includes are passed to GCC, but I’m not sure. I will continue working on this until I fix it, however if someone else has encountered this and fixed it, please let me know! It’s driving me mad.
OK.
I found a fix that worked.
Step
- Take the project off Build Automaticlly setting via the menu item “Properties | Build Automaticlly” (it’s not useful in C/C++ projects)
2). Open the makefile. Find CFLAGS. Directories to search for include files of the type #include "foo.h"
should be included using the -iquote option. Directories to search for include files of the type ```
#include <bar.h>
There are various man files for gcc available on the internet. There are many versions of gcc, with many different options. What bit me (and might bite you) was getting an old manual entry for a more modern gcc implementation.
I spent several long days going crazy tring to get the build stuff to work on Eclispe 3.2. I followed the Lynch tutorial and used the manual make file. That worked ok.
Then, I started an AVR project in a different workspace and got the WinAVR gcc stuff to work easily in auto mode.
Then I discovered YAGARTO. I uninstalled the old stuff and installed YAGARTO. I works fine for Phillips. But I want to try out the Luminary chips and am having a fundamental problem with my (non)understanding of unix file systems and how gcc is structured.
I have on my XP laptop WinAVR installed. I also have the gnu arm gcc from YAGARTO. I then downloaded the CodeSourcery free arm-none-eabi version of gcc 4.1 so I could use the updated thumb2/cortex options.
Now, when I look at my paths - its a MESS!!
Why does each installation have e.g. an arm-elf-gcc folder, which contains another arm-elf folder and a seperate bin, include and library folder. It seems as if theres a “normal” version of gcc in the second folder named arm-elf, but that in the inner bin folder, there’s the specialized version.
I was under the impression that gcc was gcc, and that the changes necessary for each flavor of micro was only a library. I think I have way too many versions on my laptop.
Anoyone out there who can explain how this works to an old dense one such as myself?
Thanks.
jc