Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » namespace name and headers not recognized
namespace name and headers not recognized [message #780310] Tue, 17 January 2012 15:29 Go to next message
fabio T is currently offline fabio TFriend
Messages: 4
Registered: December 2009
Junior Member
Hi everyone,
I'm working on a rather huge C++ project, which encompasses a number of custom headers (.hpp) and namespaces. I've been given this project so I didn't start it myself.

Now, when building the project, the g++ compiler complains about missing headers and a namespace name not recognised. This happens only with few files, not in every where those headers are included or the namespace is used.

Specifically, there's a directory called 'ff' which contains various .hpp headers which I use. I added this directory ( and all subdirectories ) to the include path. Most of the headers contained in such directory are used throughout the project and are properly found, except for a couple of them, which I checked and are actually there!
#include "ff/farm.hpp"
#include "ff/lb.hpp"
#include "ff/gt.hpp"
#include "ff/node.hpp" 


About namespace, there is just one .cpp file, where I use the command
using namespace ff;

which actually exists, but the compiler complains with: "expected namespace-name before ';' token". Notice that I also use that namespace somewhere else in the project and there it is ok.

Worst, sometimes in the same .cpp file - maybe only few rows below - functions like "gettimeofday(&time_misuration, NULL);" are marked either as "not declared in this scope" or are just fine!

I've been struggling with this for days now, and I tried everything I knew that could solve the problem: rebuild indexes, clean and rebuild the project, check and re-check paths and toolchain. The problem is still there.

Help! Help! Help!
Re: namespace name and headers not recognized [message #780480 is a reply to message #780310] Wed, 18 January 2012 08:59 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Quote:
Specifically, there's a directory called 'ff' which contains various .hpp headers which I use. I added this directory ( and all subdirectories ) to the include path. Most of the headers contained in such directory are used throughout the project and are properly found, except for a couple of them, which I checked and are actually there!
#include "ff/farm.hpp"
#include "ff/lb.hpp"
#include "ff/gt.hpp"
#include "ff/node.hpp"

You need to add to the include path the folder above "ff". The compiler will look for header files in $INCLUDE_PATH/$_YOUR_INCLUDE_DIRECTIVE.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: namespace name and headers not recognized [message #783848 is a reply to message #780480] Thu, 26 January 2012 15:25 Go to previous message
fabio T is currently offline fabio TFriend
Messages: 4
Registered: December 2009
Junior Member
Quote:

You need to add to the include path the folder above "ff". The compiler will look for header files in $INCLUDE_PATH/$_YOUR_INCLUDE_DIRECTIVE.


This is driving me crazy! actually, the folder above "ff" is the root folder of the project. Anyway I added it to the include path and this solved the problem.
But, it triggered other errors, like the compiler can't reference some boost libraries.

like this;

#include <boost/program_options.hpp>
namespace po = boost::program_options;
...

po::options_description desc("Allowed options");


the last statement gives an error "undefined reference to boost::program_options::options_description::options_description", together with a number of other similar errors which weren't there before.

not to mention other "undefined references" to functions which were fine before!
Previous Topic:C++ program built successfully but does not run
Next Topic:How to configure CDT toolchains for MinGW64?
Goto Forum:
  


Current Time: Fri Apr 26 12:49:53 GMT 2024

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

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

Back to the top