Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6861641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:33:38+00:00 2026-05-27T02:33:38+00:00

I’m trying to create an SDL game with Visual Studio 2010, but I’m getting

  • 0

I’m trying to create an SDL game with Visual Studio 2010, but I’m getting a lot of compile errors when I try to build the project. I followed this tutorial to set up Visual Studio, and I’m following this tutorial for SDL. The two portions of code that are giving me these errors is my CApp_OnEvent and CApp files.

CApp_OnEvent:

#include "CApp.h"

void CApp::OnEvent(SDL_EVENT* Event) {
}

CApp:

#include "CApp.h"

CApp::CApp() {
Running = true;
}

int CApp::OnExecute() {
if(OnInit() == false) {
    return -1;
}

SDL_EVENT Event;

while(Running) {
    while(SDL_PollEvent(&Event)) {
        OnEvent(&Event);
    }

    OnLoop();
    OnRender();
}

OnCleanup();

return 0;
}

int main(int argc, char* argv[]) {
CApp theApp;

return theApp.OnExecute();
}

Here’s the output of Visual Studio when I try to build it:

1>------ Build started: Project: SDL Game, Configuration: Debug Win32 ------
1>Build started 11/24/2011 10:58:45 AM.
1>InitializeBuildStatus:
1>  Touching "Debug\SDL Game.unsuccessfulbuild".
1>ClCompile:
1>  CApp_OnRender.cpp
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp.h(18): error C2061: syntax error : identifier 'SDL_EVENT'
1>  CApp_OnLoop.cpp
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp.h(18): error C2061: syntax error : identifier 'SDL_EVENT'
1>  CApp_OnInit.cpp
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp.h(18): error C2061: syntax error : identifier 'SDL_EVENT'
1>  CApp_OnEvent.cpp
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp.h(18): error C2061: syntax error : identifier 'SDL_EVENT'
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp_onevent.cpp(3): error C2065: 'SDL_EVENT' : undeclared identifier
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp_onevent.cpp(3): error C2065: 'Event' : undeclared identifier
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp_onevent.cpp(3): error C2448: 'CApp::OnEvent' : function-style initializer appears to be a function definition
1>  CApp_OnCleanup.cpp
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp.h(18): error C2061: syntax error : identifier 'SDL_EVENT'
1>  CApp.cpp
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp.h(18): error C2061: syntax error : identifier 'SDL_EVENT'
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp.cpp(12): error C2065: 'SDL_EVENT' : undeclared identifier
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp.cpp(12): error C2146: syntax error : missing ';' before identifier 'Event'
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp.cpp(12): error C2065: 'Event' : undeclared identifier
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp.cpp(15): error C2065: 'Event' : undeclared identifier
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp.cpp(15): error C3861: 'SDL_PollEvent': identifier not found
1>c:\users\nathan\documents\visual studio 2010\projects\sdl game\sdl game\capp.cpp(16): error C2065: 'Event' : undeclared identifier
1>  Generating Code...
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.24
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

You can view the rest of my project code by going here:
http://www.mediafire.com/download.php?5524qr1zodracc5

Any ideas on why I’m getting these errors? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:33:38+00:00Added an answer on May 27, 2026 at 2:33 am

    Well, I’ve answered my own question again. I needed to be using SDL_Event, not SDL_EVENT.

    hangs head in shame for such a stupid mistake

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.