If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

The error being is CGameApplication can't be recognized, undefined or something.
There is a space in between the project name such as "Simulation V2.0"
When I do,
using namespace Simulation V2.0 or using namespace "Simulation V2.0", the compiler complains.
I have made a reference in the .NET section of the test project to no avail
Please help
Thanks
Jack

Re: Spacing problem of namespaces in C++ unit testing

Of course, Simulation V2.0 is not a valid C++ or C++/CLI namespace name: The space isn't legal in an identifier, nor is the dot. And enclosed in double quotes it's even more invalid (in case that's even possible... ): These are just for string literals. How did that namespace name get created? As per my experience, the IDE should take care of converting problematic project names into valid namespace names. For instance, I have a project named 7segTest (not a valid C++ identifier due to the digit at the beginning) for which the IDE (VC++ 2010 Express) created a namespace named My7segTest - simple but effective.

BTW, I don't see any instance of the offending namespace name in the code snippet you posted. How are they related?

I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Re: Spacing problem of namespaces in C++ unit testing

Let me explain my procedure, I created a unit test project from the solution menu. I add a reference to the .NET framework.
It says PerfectSim V5.0 in the reference list box, that is fine. But when I created a CGameApplication which is a class under the solution/project names
It is underlined, meaning not recognized. Just don't know why.
Thanks
Jack

Re: Spacing problem of namespaces in C++ unit testing

I must admit I never used that testing framework, one of the reasons being that it simply isn't even part of the Express Edition I'm using. Nonetheless I'm gaining the impression that this actually isn't a C++/CLI issue, rather one regarding the testing framework. Even if it's a problem that the testing framework specifically fails to handle C++/CLI projects the way they get set up by the IDE, I still wouldn't regard that a C++/CLI issue.

At any rate, we settled on that somthing containing a space and a dot is not a valid namespace name. And as pointed out above, the IDE usually converts project names that aren't valid namespace names into valid namespace names. It shouldn't be too complicated for you to find out what namespace the IDE created as the application namespace for your project. For instance, it should be obvious in class view:

I hope that then, once you know the actual namespace created, there's a way you can set up the test framework to use that instead of the one it apparently has created itself by simply taking the project name.

HTH

Originally Posted by lucky6969b

It says PerfectSim V5.0 in the reference list box, that is fine.

Wow, the development of PerfectSim seems to progress at above light speed: from V2.0 to V5.0 within less than one day!

I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.