Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Could not find include file on include paths(Error resolving include files)
Could not find include file on include paths [message #885345] Tue, 12 June 2012 21:05 Go to next message
john smith is currently offline john smithFriend
Messages: 2
Registered: June 2012
Junior Member
I am using Eclipse to edit an existing project on my Mac. First, I'm not sure why but I had to tell Eclipse where to find the stl c++ include files. After I did this it was able to resolve the string, vector, etc classes but there were a few that it still couldn't find such as function and shared_ptr.

I discovered that these are new to C++11 and downloaded gcc-4.8 (precompiled from HPC for Mac OS X) and added the include path ("/usr/local/include/c++/4.8.0") and removed the old one.

Now what I can't figure out is why Eclipse can find the main include files (e.g. string and vector) but some of the includes within the include it cannot find. For example, inside <memory> is an include for <bits/shared_ptr.h> which is in the directory /usr/local/include/c++/4.8.0/bits but it says it could not find the file. Some of the files it can find though such as "bits/stl_vector.h" but it still has an error for vector saying "Symbol 'vector' could not be resolved."

Any clue on what I'm doing wrong?
Re: Could not find include file on include paths [message #885353 is a reply to message #885345] Tue, 12 June 2012 21:26 Go to previous messageGo to next message
john smith is currently offline john smithFriend
Messages: 2
Registered: June 2012
Junior Member
Ok I kinda answered my own question. There were more includes that I had to add based on the processor architecture (specifically /usr/local/include/c++/4.8.0/x86_64-apple-darwin11.4.0).

Though it still cannot find "pair" and a few others.

[Updated on: Tue, 12 June 2012 21:33]

Report message to a moderator

Re: Could not find include file on include paths [message #885510 is a reply to message #885353] Wed, 13 June 2012 06:42 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
The scanner discovery (see Project Properties->C/C++ Build->discovery options) uses gcc with some special command line options (-E -P -v -d) to get the path to the system headers. In order to use the C+11 headers you should add "-std=c++0x" to the command line options.
see http://www.eclipse.org/forums/index.php/m/792796/?srch=discovery+scanner+c%2B11#msg_792796

I added an entry to the the CDT FAQ http://wiki.eclipse.org/CDT/User/FAQ#CDT_does_not_recognize_C.2B.2B11_features


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:VM arguments
Next Topic:Gdb Pretty Print on Windows
Goto Forum:
  


Current Time: Fri Apr 26 09:19:50 GMT 2024

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

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

Back to the top