Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Unresolved inclusion in hello world(can build, run but unresolved inclusion)
Unresolved inclusion in hello world [message #544830] Mon, 05 July 2010 12:17 Go to next message
Eclipse UserFriend
Unpacked Eclipse CDT Helios, created C++ hello world project with internal builder. And here is what I see:
http://i49.tinypic.com/muj1i8.png
It is possible to build project. MinGW is in C:\MinGW, and C:\MinGW\bin is in PATH. How can this be fixed?
Re: Unresolved inclusion in hello world [message #544843 is a reply to message #544830] Mon, 05 July 2010 12:57 Go to previous messageGo to next message
Eclipse UserFriend
On Mon, 05 Jul 2010 12:17:03 -0400, Nobody <cdtfan@gmail.com> wrote:

>Unpacked Eclipse CDT Helios, created C++ hello world project with internal builder. And here is what I see:
>
>It is possible to build project. MinGW is in C:\MinGW, and C:\MinGW\bin is in PATH. How can this be fixed?

Can't see anything here. Are you trying to send binaries? This isn't a
binary newsgroup as far as I'm aware. You'll have to describe it in
words.
Re: Unresolved inclusion in hello world [message #544849 is a reply to message #544843] Mon, 05 July 2010 13:27 Go to previous messageGo to next message
Eclipse UserFriend
Sorry for inconvenience, I have just posted on http://www.eclipse.org/forums and inserted some screenshots with the button.

The problem is that in Hello World Project after Wizard Eclipse shows that #include <iostream> is unresolved. But it is obviously resolved, because it is possible to compile and run the program. So why does it says that inclusion is unresolved?
Re: Unresolved inclusion in hello world [message #544988 is a reply to message #544849] Tue, 06 July 2010 05:07 Go to previous messageGo to next message
Eclipse UserFriend
On Mon, 05 Jul 2010 13:27:40 -0400, Nobody <cdtfan@gmail.com> wrote:

>Sorry for inconvenience, I have just posted on http://www.eclipse.org/forums and inserted some screenshots with the button.
>
>The problem is that in Hello World Project after Wizard Eclipse shows that #include <iostream> is unresolved. But it is obviously resolved, because it is possible to compile and run the program. So why does it says that inclusion is unresolved?

The "unresolved" thing is due to code assistance not being able to
find it. When you run the compiler it will use its own set of default
include paths, but Eclipse doesn't know about those unless you tell it
about them.

Right click on the project and select Properties. Now expand "C/C++
General" and look in "Paths and Symbols". You need to add your
compiler paths in there. There may be some default ones, but that
depends on how you've configured your prokect when you created it.
Re: Unresolved inclusion in hello world [message #545109 is a reply to message #544988] Tue, 06 July 2010 12:26 Go to previous messageGo to next message
Eclipse UserFriend
John McCabe wrote on Tue, 06 July 2010 05:07

The "unresolved" thing is due to code assistance not being able to
find it. When you run the compiler it will use its own set of default
include paths, but Eclipse doesn't know about those unless you tell it
about them.

Right click on the project and select Properties. Now expand "C/C++
General" and look in "Paths and Symbols". You need to add your
compiler paths in there. There may be some default ones, but that
depends on how you've configured your prokect when you created it.

"Paths and Symbols" is empty for all languages in properties of the project. The project was created with the wizard as New->C++ Project->Hello World C++ Project with MinGW toolchain. Do I have to manually add default C++ compiler include directories? Why Eclipse can't find them if it has already found the compiler and can build the project?
Re: Unresolved inclusion in hello world [message #545117 is a reply to message #545109] Tue, 06 July 2010 12:48 Go to previous messageGo to next message
Eclipse UserFriend
On Tue, 06 Jul 2010 12:26:38 -0400, Nobody <cdtfan@gmail.com> wrote:

>John McCabe wrote on Tue, 06 July 2010 05:07
>> The "unresolved" thing is due to code assistance not being able to
>> find it. When you run the compiler it will use its own set of default
>> include paths, but Eclipse doesn't know about those unless you tell it
>> about them.
>>
>> Right click on the project and select Properties. Now expand "C/C++
>> General" and look in "Paths and Symbols". You need to add your
>> compiler paths in there. There may be some default ones, but that
>> depends on how you've configured your prokect when you created it.
>
>"Paths and Symbols" is empty for all languages in properties of the project. The project was created with the wizard as New->C++ Project->Hello World C++ Project with MinGW toolchain. Do I have to manually add default C++ compiler include directories? Why Eclipse can't find them if it has already found the compiler and can build the project?

It's not Eclipse that's finding them when it builds the project; the
compiler is using its own default include paths.

In saying that, CDT normally can work out the include paths so I'm not
sure about that, but if you put them in manually I'm sure it will
work.
Re: Unresolved inclusion in hello world [message #545253 is a reply to message #545117] Wed, 07 July 2010 06:05 Go to previous messageGo to next message
Eclipse UserFriend
The scanner info generator should locate the system include paths automatically. It should *not* be necessary to add them manually.
The scanner can be configured in the project properties C/C++ Build->Discovery Options.
The scanner calls gcc/g++ to get the include paths and symbols. Perhaps this fails in your case. What are your settings?
Re: Unresolved inclusion in hello world [message #778475 is a reply to message #545253] Thu, 12 January 2012 14:20 Go to previous messageGo to next message
Eclipse UserFriend
I had this problem too. What it works for me:

At eclipse: project > properties > C/C++ General > Paths and Symbols > GNU C++ > Add : C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++

VERSIONS:
MinGW version: 4.6.2

Regards: framontb
Eclipse IDE for C/C++ Developers
SOLVED by Workaround [message #788114 is a reply to message #544830] Wed, 01 February 2012 06:06 Go to previous message
Eclipse UserFriend
Hello,

I solved this issue by following workaround. To get Eclipse aware of the changes I have to

  1. delete the *.sc files in my workspace in
    workspace\.metadata\.plugins\org.eclipse.cdt.make.core\

  2. clear the settings in "Project properties > C/C++ Build > Discovery Options > Clear discovered entries now:"
  3. restart "eclipse -clean"
  4. open project properties and add under "Project properties > C/C++ General > PAths and Symbols > Includes" the following paths
    c:\MinGW\include\
    c:\MinGW\lib\gcc\mingw32\4.6.2\include\c++\
    

It is important that the paths do end with a slash!

[Updated on: Wed, 01 February 2012 06:20] by Moderator

Previous Topic:Undefined reference to problem
Next Topic:Linker error with codesourcery
Goto Forum:
  


Current Time: Thu Jul 03 09:10:20 EDT 2025

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

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

Back to the top