I have a bit of an issue. I'm trying to make my objects and everything, but I always run into this error. No, not always. Just with these two files, MainMenu.cpp/hpp and SplashScreen.cpp/hpp.
I'll try the following code like:
MainMenu mainMenu;
Imediatly it says ther there is a missing ";" before the identifier mainMenu, when I hover over it, Visual Studio pop's up with "Error, Expected a ";""
I've looked at my files, and they look just fine, I'll show MainMenu.cpp and .hpp
MainMenu.cpp
#include "stdafx.h"
#include "MainMenu.h"
void MainMenu::GetResult(sf::RenderWindow& renderWindow)
{
//Not yet finished...... obviously.
}
MainMenu.h
#ifndef MAINMENU_H
#define MAINMENU_H
class MainMenu{
public:
void GetResult(sf::RenderWindow& renderWindow);
enum MainMenuResult{Play,Quit,Load};
};
#endif
Now I know how this error can kinda roll down from any linked file, so I'll also show stdafx
stdafx.h
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifndef STDAFX_H
#define STDAFX_H
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#include <iostream>
// TODO: reference additional headers your program requires here
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#endif
As I said, I can't find were its saying I'm missing an ";". To me the whole error really makes no sense. I mean, it works with BetweenScreens, and thats just a bunch of random public methods for loading screens. So, yea, I look foreward to hearing if anyone else ever had this issue.
Yes, I used google, but the problem seems to have a unlimited ammounts of fixes/causes so it wasn't much help.
Anyways, let me know what you think, and have a wonderful day!
EDIT, oh almost forgot the original position of the erroring code in the main file:
void Genesis::loadMainMenu(sf::RenderWindow& renderWindow)
{
BetweenScreens betweenScreens; //Works Fine
betweenScreens.LoadingMenuScreen(renderWindow);
MainMenu mainMenu; //Error ...and will still error if I got rid of the above code.
}