I have installed lubuntu today on my old laptop.Then I created
new project in code::blocks and it had no compiler which was weird so
I installed g++ using terminal(sudo apt-get install g++)
everything went well then I downloaded SDL(libSDL2.dev) because I wanted to start developing
a simple game so tested it if it works by creating simple window and rederer in a main function.Everything was still good.So I then moved all that code into different class and then run it through pointer(game->init()) but when I tried to compile it boom like 1000 lines of errors basically saying that nothing was declared so I tried to look for the problem but nothing seemed wrong the header was included no compile error in the header.Then I tried to compile it using terminal still the same problem . so I tried to write simple program that just uses variable from header file and prints it on screen still the same problem.
error: 'Header::Header' names the constructor, not the type
This:
1 2 3
Header::Header // error
{
}
should be:
1 2 3
Header::Header()
{
}
Unrelated notes:
* Your main includes "Header,h". The comma is a typo?
* Your main merely declares a pointer. A forward declaration -- class Header; -- would suffice. Include is not needed.
* Your Header.h includes <iostream>, but does not need it. The .cpp does. Avoid unnecessary includes on header files.
* Is the flush necessary? The endl is '\n' + flush(). Usually the '\n' is enough.