Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Build failure on stock "C++ Hello World" project(CentOS Linux fails to build standard starter project)
Build failure on stock "C++ Hello World" project [message #838350] Sat, 07 April 2012 00:03 Go to next message
Robert Ashforth is currently offline Robert Ashforth
Messages: 3
Registered: April 2012
Junior Member
I'm no stranger to building C++ code on Linux, but as part of setting up a dev environment on a VM at home, I installed Eclipse with CDT and expected the standard 'C++ Hello World' to succeed as a standard verification of a working environment... but it doesn't.

I get numerous failures for missing type definitions in the system header files (most stemming from the 'cout' call), and so went looking for the settings which determine default include paths; eventually I found them in a file with the 'sc' filetype, under the .metadata/.plugins subdirectory for the cdt core make values. This is not documented anywhere that I can find, but I'm guessing that it is created by the automatic path discovery feature.

Before I just discard this and go through the process of setting everything up by hand, is this problem experienced by anyone else? If it turns out to be something I've overlooked, I won't mind in the slightest. Smile

Thanks-

Bob
Re: Build failure on stock "C++ Hello World" project [message #840591 is a reply to message #838350] Tue, 10 April 2012 09:20 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1952
Registered: July 2009
Senior Member
You are right . The sc file is created by the automatic include path discovery. You should not edit it manually.
Does the folder "Includes" in your Project Explorer contain all the system headers? Can you select e.g. io.h in your source file and pressing F3 will open the correct system header? Did you rebuild the index (Project properties->Index)?


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Build failure on stock "C++ Hello World" project [message #840866 is a reply to message #840591] Tue, 10 April 2012 15:46 Go to previous messageGo to next message
Robert Ashforth is currently offline Robert Ashforth
Messages: 3
Registered: April 2012
Junior Member
Thanks, Axel.

I'm guessing that the path discovery result was not accurate, as the initial build produced close to 600 errors stemming from inclusion of the iostream header, which couldn't locate a large number of system-defined symbols/classes.

I've rebuilt the index repeatedly, after adding various system directories to the include directories via the Project Properties dialog.

At this point, I'm going to create a new VM, and add as little as possible to it before doing a test build of CDT. This is because I ended up with both 4.4.4 and 4.4.6 versions of the c++ include directories, and the 4.4.6 is nothing more than a soft link to the 4.4.4 version... which makes me wonder about the relative paths that I find in the .sc file. (Relative paths including '..' don't play well with soft links.)

The reason I'm going to try this is that I added a number of packages that I prefer to work with, and one of those might have been the reason the soft link was added. If I get solid information from this experiment on what's wrong with the environment, I'll try fixing my existing VM as a proof that I've got the right root cause identification.

I'll update this thread once I have the results of that experiment. I am intending to join the contributor list for CDT anyway, so perhaps I'll be in the position of reporting a bug and resolving it myself. Smile

Thanks again-

Bob
Re: Build failure on stock "C++ Hello World" project [message #841162 is a reply to message #840866] Wed, 11 April 2012 01:07 Go to previous message
Robert Ashforth is currently offline Robert Ashforth
Messages: 3
Registered: April 2012
Junior Member
OK. This time I did not download and install the preset Eclipse C++ package set, but instead just included Eclipse (Helios) in the initial VM configuration, and added the CDT plugin afterwards.

Everything worked fine for the 'Hello World' compilation and execution, so apparently I hit a corner case somehow, probably related to the order of installation of some rpm that caused an issue with the path discovery.

Thanks again for the reply, Axel.

Bob
Previous Topic:Helios CDT package will not install under centOS 6.2
Next Topic:build multiple artifact?
Goto Forum:
  


Current Time: Tue Sep 23 08:32:31 GMT 2014

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

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