header file failed to pass

I have a.h as follows
1
2
3
4
5
6
7
8
namespace one{
namespace two{

enum Filter {
  GRAPE, COSINE, SYNC
};
}
}


If I do this in another header file b.h

1
2
3
4
5
6
7
#include <one/two/a.h>

namespace one {
namespace three {

}
}


I get error 'n' does not name a type.
Please, kindly help
Last edited on
#include "a.h" or #include "one/two/a.h" if that is the correct relative path from the current directory.

And it needs an include guard: http://en.wikipedia.org/wiki/Include_guard
Last edited on
Thanks JLBorge.

I tried your suggestion modifying the include directives for a.h in b.h and by adding the guard in a.h as follows
1
2
3
4
5
6
7
8
9
10
11
12
13
 
// guard
#ifndef A_H
#define A_H
namespace one{
namespace two{

enum Filter {
  GRAPE, COSINE, SYNC
};
}
}
#endif 


With the above I get
 
error: expected unqualified-id before '/' token
for the comment above the guard

And
 
error: 'i' does not name a type
for the 'i' in ifndef
Last edited on
I saw the culprit.
I copied the source to a text editor, saved and everything was fine.
Apparently, some weird characters were been attached automatically somewhere.
Topic archived. No new replies allowed.