-
July 20th, 2013, 01:52 PM
#1
SDL issues
I am trying to use SDL to make a movie easter egg. The movie code is
Code:
#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_Delay(2000);
SDL_FreeSurface( frame1 );
SDL_Quit();
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.
-
July 21st, 2013, 04:46 AM
#2
Re: SDL issues
Victor Nijegorodov
-
July 21st, 2013, 06:27 AM
#3
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. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|