SDL issues
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: SDL issues

  1. #1
    Join Date
    Jul 2013

    Question SDL issues

    I am trying to use SDL to make a movie easter egg. The movie code is

    #include <iostream>
    #include <string>
    #include "SDL.h"
    using namespace std;
    int i;
    int main(int argc, char* args[]) {
         cout << "Welcome to the movie easter egg.";
         i = 1;
         if (i == 1) {
         SDL_Surface* frame1 = NULL;
        SDL_Surface* screen = NULL;
        if((SDL_Init(SDL_INIT_EVERYTHING)==-1)) { 
        cout << "Error initiating movie."; }
        screen = SDL_SetVideoMode( 640, 480, 64, SDL_HWSURFACE );
        frame1 = SDL_LoadBMP( "C:\\Users\\User\\Desktop\\Frames\\Frame1.bmp" );
         SDL_BlitSurface( frame1, NULL, screen, NULL );
        SDL_Flip( screen );
        SDL_FreeSurface( frame1 );
        return 0;
    I am running Dev-C++ on windows 7 and I followed Lazy-foo's tutorial. I get a linker error in the form of

    [linker error] undefined reference to 'SDL_Init'

    and I get linker errors to everything sdl in the code also. I also get a linker error to winmain@16. This isn't a project but a source file. I am not going to create a project unless it is absolutely necessary. Please help.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Wallisellen (ZH), Switzerland

    Re: SDL issues

    Victor Nijegorodov

  3. #3
    Join Date
    Dec 2012

    Re: SDL issues

    Linker errors usually mean that you haven't told the linker that you are using certain libraries. You need to specifiy to the linker what .lib files SDL require.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a survey!

HTML5 Development Center