0

Header 1 : fml32.h

#ifndef TMENV_H
#include <tmenv.h>
#endif

_TMIFML32 extern        char    *Femsgs32[];

Header 2 : tmenv.h

#ifndef TMENV_H
#define TMENV_H 1

#define _TMIFML32
#endif

I'm trying to compile a .cpp file that includes "fml32.h". It's throwing an error from fml32.h saying:

error: '_TMIFML32' does not name a type

TMENV_H is not defined anywhere. Tried commenting #ifndef TMENV_H and its endif from Header 2 because I was suspecting that control is not reaching #define _TMIFML32. But still the same error. Can anyone help on this? Would be really grateful.

Eugene Lisitsky
  • 12,113
  • 5
  • 38
  • 59
JSRK
  • 61
  • 1
  • 6
  • what makes you sure that "TMENV_H is not defined anywhere"? – Ap31 Dec 16 '16 at 10:39
  • Does `tmenv.h` include `fml32.h`? – Some programmer dude Dec 16 '16 at 10:39
  • 3
    The only place `#ifndef TMENV_H` belongs is as the header guard *inside* `tmenv.h`. And rather than commenting out the only place that macro should be tested (in the header), why don't you (a) remove the one in `fml32.h`, and (b) slap a `#error This better puke` *inside* the header guard of `tmenv.h`, then compile and see if it trips. If it doesn't, then either someone else defined that macro already, or that header isn't the one you're consuming. – WhozCraig Dec 16 '16 at 10:47
  • Please show the minimal CPP file that includes fml32.h and include a trivial main. **Make sure that compiling it fails on your system** , then post all three files. At the moment I think we should close this as "no [mcve]", but I suspect the problem is a trivial configuration error as WhozCraig suggests, and we should close it as such. – Martin Bonner supports Monica Dec 16 '16 at 10:56
  • fml32.h includes tmenv.h. – JSRK Dec 16 '16 at 11:56
  • fml32.h includes tmenv.h. can't remove it from fml32.h because I need _TMIFML32 extern char *Femsgs32[]; – JSRK Dec 16 '16 at 11:58

1 Answers1

0

maybe you should try to enclose your header name in "" ("localheader.h") if it is in local directory.? (this, of course, should be a comment).


BTW, according to cppreference:

  • the identifiers with a double underscore anywhere are reserved;
  • the identifiers that begin with an underscore followed by an uppercase letter are reserved;
  • the identifiers that begin with an underscore are reserved in the global namespace.
Volodymyr Boiko
  • 1,533
  • 15
  • 29