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 4620320
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:32:40+00:00 2026-05-22T02:32:40+00:00

im writing a sample SDL program, and I just wrote the simplest program, but

  • 0

im writing a sample SDL program, and I just wrote the simplest program, but i get the following error because of my SDL_pollevent() function:

Test.cpp:(.text._ZN4CApp9OnExecuteEv[CApp::OnExecute()]+0x41): undefined reference to `SDL_PollEvent'
collect2: ld returned 1 exit status

and the code is:

int OnExecute()
{
    if(OnInit()==false)
        return -1;
    SDL_Event Event;
    while(Running)
    {
        while(SDL_PollEvent(&Event))
        {
            OnEvent(&Event);
        }
            OnLoop();
        OnRend();
    }
    OnClean();
    return 0;
}
  • 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-22T02:32:41+00:00Added an answer on May 22, 2026 at 2:32 am

    This is a linker error. You are not correctly linking the SDL libraries to your project. Usually you would need to add -lSDL to your linker. If you are using Windows I believe you have to add -lSDLmain too. Make sure your compiler knows where to find these files (set your library path correctly). If you don’t know how to do this, check the system and IDE specific installation instructions in this tutorial.

    I assume that SDL_Init() is called within OnInit()? Otherwise your program will not run correctly.

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

Sidebar

Related Questions

I'm writing a simple program using SDL, but I'm running into a strange problem.
I'm writing a small sample iphone application just to consume a SOAP Web service.
I'm writing a sample test with Watir where I navigate around a site with
I'm writing a simple program for testing mouse. It compiles fine, but doesn't work.
Every sample I've found of doing this consists of writing a function outside of
I am just writing some dummy code for pygame. The first sample of code
I'm writing a sample console service host and I want to plug into WCF
I am writing a toolbar for IE(6+). I have used the various sample bars
I'm writing code to use UIImagePickerController. Corey previously posted some nice sample code on
I'm writing simple program to communicate between smart devices and I receive 11001 when

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.