I don't recommend asking for help with code and just saying that there is an error somewhere. Luckily this is short code and you used code tags. Like Olysold said you shouldn't be putting your global main in a header file, it has to be in a .cpp file. I don't see anything wrong with your code regarding namespace. You didn't make an object for your struct. You can't just use the class. Imagine you had a class for cars in general. The class would be the blueprint on details that you know all cars have. How many wheels, length, weight etc. The objects you declare however are the actual cars. You have to declare the object then use it.