Create a new namespace in VS for a C++ project

Does anyone know how to create a NEW namespace in Visual Studio 2015? Not change the default one's name, but to create an entirely new one in addition.
It is surprisingly difficult to find any articles or videos showing how to do it. In Eclipse you have the option to create one when you're using the wizard window to add a new class to your project. Not in VS. When you add a new class, you can only create a class not a new namespace. Thanks
What's preventing you from adding the namespace with your keyboard?
1
2
3
4
5
namespace pabs8
{


} // End of namespace pabs8 
When I do it manually, I get errors like unresolved externals. I've tried to use/invoke this namespace in the .h and the other .cpp file

I think I'll have to create additional .cpp and .h files and then try to type in the new class and see if it works. I thought VS might've done this for you automatically.
Last edited on
When you create a C++ project, only the global namespace exists: i.e. the namespace where anything that isn't in a user-defined namespace exists.

In addition, do not put your main() function - your program's entry point - into a namespace. Doing so will prevent it from being called, since it is assumed to be part of the global namespace.

If you need help, email me at: sparkprogrammer@gmail.com
Attach your files as well so that I can look at them - should be easier than pasting it here.

Joe
sparkprogrammer@gmail.com
Topic archived. No new replies allowed.