Hi,

I'm trying out PB for a C++ class at school. The program in question
needs a main file and implementation file (.cpp) and a header file (.h).

This is a two-part question of sorts: with and without namespaces.

With namespaces, PB fails to recognise any standard library items,
particularly NULL and cout...despite the presence of "using namespace
std;". Specifically:

#include "header.h"

using namespace std;

namespace SomeStupidName {
AnotherClass::AnotherClass() {
int *myPointer = NULL; // error here
cout << "stuff\n"; // error here
} }
}

This is a simplified example of what I copied straight from the textbook,
namespaces and all. CodeWarrior also fails to recognise anything in
stdlib.

A friend suggested stripping out the namespaces. I did that, leaving the
header file to look like this:

class AnotherClass {
public:
//Constructor
AnotherClass();
};

PB now complains that AnotherClass was redefined. I'm not aware of a
previous definition of AnotherClass, so this is indeed a strange error.

What am I/my textbook doing wrong? Is this a combined PB/CodeWarrior
quirk, perhaps? What can I do to get around this?

Keep in mind I might have made an error in editing the sample code above;
the real code is unnecessarily complicated for viewing audiences.

If you need further info I will be glad to help. Thanks.