c++ - Namespace in header
- Charl Marais (17/17) May 05 2003 Hi all
- Jan Knepper (7/24) May 05 2003 news://forums.inprise.com/borland.public.cppbuilder.commandlinetools
- Charl Marais (3/20) May 05 2003 Thanks
- Walter (5/6) May 09 2003 I'm afraid that's a borland compiler problem. The solution is to downloa...
Hi all I'm trying to compile a very simple program from an example out of a book. Unfortunately, when I compile the header file, I get: Error E2141 PromptModule.h 4: Declaration syntax error with the code: #ifndef PromptModuleH #define PromptModuleH namespace PromptModule //where error occurs { void PauseProgram(); } #endif If I take the namespace code out, it works fine. It also compiles the cpp file with namespace code in. I'm using Borland 5.5 compiler on windows XP. Any help will be appreciated thanks Charl Marais
May 05 2003
news://forums.inprise.com/borland.public.cppbuilder.commandlinetools You should FORCE the compiler to process the HEADER file as C++ file with dmc -c -cpp PromptModule.h More normal is including the .h file into a .cpp file. ManiaC++ Jan Charl Marais wrote:Hi all I'm trying to compile a very simple program from an example out of a book. Unfortunately, when I compile the header file, I get: Error E2141 PromptModule.h 4: Declaration syntax error with the code: #ifndef PromptModuleH #define PromptModuleH namespace PromptModule //where error occurs { void PauseProgram(); } #endif If I take the namespace code out, it works fine. It also compiles the cpp file with namespace code in. I'm using Borland 5.5 compiler on windows XP. Any help will be appreciated thanks Charl Marais
May 05 2003
Thanks "Charl Marais" <NO__SPAM_maraischarl hotmail.com> wrote in message news:b976lb$1kha$1 digitaldaemon.com...Hi all I'm trying to compile a very simple program from an example out of a book. Unfortunately, when I compile the header file, I get: Error E2141 PromptModule.h 4: Declaration syntax error with the code: #ifndef PromptModuleH #define PromptModuleH namespace PromptModule //where error occurs { void PauseProgram(); } #endif If I take the namespace code out, it works fine. It also compiles the cpp file with namespace code in. I'm using Borland 5.5 compiler on windows XP. Any help will be appreciated thanks Charl Marais
May 05 2003
"Charl Marais" <NO__SPAM_maraischarl hotmail.com> wrote in message news:b976lb$1kha$1 digitaldaemon.com...Error E2141 PromptModule.h 4: Declaration syntax errorI'm afraid that's a borland compiler problem. The solution is to download the Digital Mars compiler from www.digitalmars.com/download/freecompiler.html
May 09 2003