Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » include paths for C(getting errors trying to include stdio.h, etc.)
include paths for C [message #1403235] Tue, 22 July 2014 14:54 Go to next message
Will Lyons is currently offline Will LyonsFriend
Messages: 6
Registered: July 2014
Junior Member
Long time Java in Eclipse user, first(-ish) time C in Eclipse user. I'm a long time C user, just not in Eclipse.

I am using the IAR Embedded Workbench v6.5 for ARM as my tool chain. I'm not concerned about getting Eclipse to compile using it, I just want to use Eclipse as an editor for now, specifically because it has pretty syntax highlighting, easier find/goto capability, and the style reformatter (shift + ctrl + F) is going to save me HOURS!

My problem is that I am getting all kinds of warnings/errors in Eclipse that appear to be a result of it not being able to find and/or parse my include files.

My main C file has the following includes:
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>

All four have a yellow question mark that says "Unresolved inclusion" when I hover over it. And of course, since it isn't parsing them, all of my variable declarations that use uint8_t, etc. are showing up as red errors with "Type 'uint8_t' could not be resolved".

I know that the header files exist in
C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.5\arm\inc\c\

I have gone to Project->Properties->C/C++ General->Paths and Symbols->Includes and added the above directory to all the languages. Eclipse shows an exclamation point in a yellow triangle for each and says "The selected folder does not exist or not accessible". I know it exists, I can see it in Windows Explorer!

For good measure I added the directory path to the Library Paths tab, and to the Preprocessor Include Path->Entries tab too. Nothing seems to help. I've closed and restarted Eclipse after making these changes.

I'm on a fresh install of Luna downloaded this morning.

Help! (Please?)

-Will
Re: include paths for C [message #1403314 is a reply to message #1403235] Tue, 22 July 2014 20:51 Go to previous messageGo to next message
Holn Kpnv is currently offline Holn KpnvFriend
Messages: 7
Registered: July 2014
Junior Member
Try to remove the last backslash
Re: include paths for C [message #1403333 is a reply to message #1403314] Wed, 23 July 2014 04:55 Go to previous messageGo to next message
newman cyriac is currently offline newman cyriacFriend
Messages: 3
Registered: July 2014
Junior Member
Can i do c project in eclipse ?
Re: include paths for C [message #1403397 is a reply to message #1403314] Wed, 23 July 2014 12:27 Go to previous messageGo to next message
Will Lyons is currently offline Will LyonsFriend
Messages: 6
Registered: July 2014
Junior Member
Holn Kpnv wrote on Tue, 22 July 2014 16:51
Try to remove the last backslash

No luck. I still get the "Unresolved inclusion" and "The selected folder does not exist or not accessible." errors. For what it's worth, I also have other included directories that have neither spaces nor ending slashes that also show up as "The selected folder does not exist or not accessible." Something is messed up, but darned if I can figure out what.
Re: include paths for C [message #1403456 is a reply to message #1403397] Wed, 23 July 2014 19:50 Go to previous messageGo to next message
Holn Kpnv is currently offline Holn KpnvFriend
Messages: 7
Registered: July 2014
Junior Member
Have you tried to use Add... -> File system... to insert the path instead of copy-paste it?
Maybe the directory is locked by a program (possibly?)

[Updated on: Wed, 23 July 2014 20:08]

Report message to a moderator

Re: include paths for C [message #1403498 is a reply to message #1403456] Thu, 24 July 2014 07:58 Go to previous messageGo to next message
SkConti Berlin is currently offline SkConti BerlinFriend
Messages: 4
Registered: April 2014
Junior Member
I think Eclipse needs a working compiler (e.g. GCC) toolchain to process the sources.

I usually create a Hello World C project (GCC toolchain) with the "New Project Wizard".
Then I test/run the build.

Then I copy all my needed files into the Hello World project on file level.
Eclipse will recognize the added files and parse them.
Re: include paths for C [message #1403732 is a reply to message #1403456] Fri, 25 July 2014 16:42 Go to previous messageGo to next message
Will Lyons is currently offline Will LyonsFriend
Messages: 6
Registered: July 2014
Junior Member
That wasn't the problem, but it did lead me to discover what part of the problem was. Apparently a "workspace path" doesn't mean what I thought it did, and I should have been leaving those boxes unchecked.

Good news: Eclipse claims it recognizes <stdint.h>

Bad news: it still doesn't understand int8_t, uint8_t, etc., even though these are defined in stdint.h

Re: include paths for C [message #1422260 is a reply to message #1403235] Fri, 12 September 2014 15:18 Go to previous message
Juan Abelaira is currently offline Juan AbelairaFriend
Messages: 1
Registered: September 2014
Junior Member
Will,
I'm using IAR EW ARM v7.0 with Eclipse Kepler. I remember I suffered something similar and just checked in my Project Properties I have added two lines in 'Include Directories':

C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.5\arm\inc

and

C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.5\arm\inc\c

This is because of some some includes like #include "./c/file.h"

Also note in my properties I have normal slashes but when copy-paste here they changed into backslashes (!?)

I got Eclipse Luna and wanted to link it to IAR but couldn't.... basically because the IAR folks haven't released the right plug-in and the current one (for Kepler) doesn't work. I didn't research any longer, but probably it's better to stick to what we know it works.
Previous Topic:turn off auto indexer
Next Topic:Using Valgrind with gdb in Eclipse
Goto Forum:
  


Current Time: Fri Apr 26 23:14:15 GMT 2024

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

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

Back to the top