namespace name and headers not recognized [message #780310] |
Tue, 17 January 2012 10:29  |
Eclipse User |
|
|
|
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
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 #783848 is a reply to message #780480] |
Thu, 26 January 2012 10:25  |
Eclipse User |
|
|
|
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!
|
|
|
Powered by
FUDForum. Page generated in 0.25611 seconds