C:\CPPProject\GameEngine.h|4|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'GameEngine'|
[/quote]
I have setup my compiler and linker settings correctly.
Compiler & Debugger Settings ->Linker Settings->Other Linker Settings: -lmingw32 -lSDLmain -lSDL
Compiler & Debugger Settings ->Search Directory->Compiler: C:\CodeBlocks\SDL\include
Compiler & Debugger Settings ->Search Directory->Linker: C:\CodeBlocks\SDL\lib
I am using CodeBlocks 10.05 and installed SDL via the DevPaks installer. .Any assistance would be greatly appreciated.
Sincerely,
Registered User
C:\CPPProject\GameEngine.h|4|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'GameEngine'|
For some reason when i try to compile my code I get the error message:
The GameEngine.h file is compiled as C code because of the main.c file which includes it. Try renaming that file to main.cpp. Also you should put header guards in the GameEngine.h file:
or
#ifndef GAMEENGINE_H
#define GAMEENGINE_H
// include required libraries
#include <SDL.h>
class GameEngine
{
private:
// screen display surface
// SDL_Surface* Screen;
public:
bool init();
void run();
};
#endif
or
#pragma once
// include required libraries
#include <SDL.h>
class GameEngine
{
private:
// screen display surface
// SDL_Surface* Screen;
public:
bool init();
void run();
};
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement