|
From: Kenneth P. R. <kpr...@op...> - 2004-02-29 06:51:58
|
I have been working through Stroustrup's "The C++ Programming Language"
Special Edition. I have run into a problemcompiling a program that
Stroustrup says compiles and runs on his system, which I believe is a
Unix system.
The code (p.109) that doesn't compile is the following:
#include <iostream>
#include <string>
#include <map>
#include <cctype>
using namespace std;
// ENUM p.109
enum Token_value{
NAME, NUMBER, END,
PLUS='+', MINUS='-=', MUL='*=', DIV='/',
PRINT=';', ASSIGN='=', LP='(', RP=')'
The error I get is the following:
'LP' redeclared as different kind of symbol
This error comes from a statement in winnt.h, which is not included.
The problem is, I have been to the C++ Learning newsgroup, and after
letting them see that winnt.h is not included, etc., etc., they have
left me with "there must be a switch in your application/IDE
configuration that is trying to write a Windows program. You need to
select configuration switches that produce a 'console' program in
Windows or a DOS program."
I am using Bloodshed 4.9.8.7, and I have never had to change the config
to compile and run other programs that come up in a DOS window. And I
have never changed the options in "Compiler Options". And also, the
options that indicate trying to support C constructs, I selected "No",
since I am trying to un-confuse myself and learn C++ only.
Does anybody have any ideas why this error from winnt.h is appearing.
Ken
|