Skip to main content
gamedev.net
🔒 Locked

including SDL into a program

Started by BloodLust666 10 replies 1k views
Original Post
BloodLust666
BloodLust666
I have compiler options to check the folder "SDL/include" for the include files and "SDL/lib" for the lib files. then i explicitly include the library in the code by doing #pragma comment(lib, "sdl.lib"), but when i run the program it's saying that it's missing "sdl.dll", how do i link that or however i need to add that?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
Shannon Barber
Shannon Barber
sdl.dll needs to be in same place as your .exe or in windows\system32.
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Vexorian
Vexorian
The lib files only exists to tell the app how should it use the DLL files.

The license won't let you have the complete SDL embedded in your app.
------ XYE - A new edition of the classic Kye
BloodLust666
BloodLust666
ah.. ok, i had to put it in the same folder. thanks, but now i'm getting an error with the Uint8 type... i guess it's not seeing it or something. is ther something wrong with it? ic an't just declare a variable with type "Uint8"?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
Frequency
Frequency
I'd check all the spelling/caps on "Uint8", since it sucks to miss really stupid errors - but I never had a problem with that when I set up. Maybe it's a linker thing?
It only takes one mistake to wake up dead the next morning.
Drew_Benton
Drew_Benton
You will need to include "SDL.h" in that file that it's not found in. As the other AP above posted, Uint8's are just typedefs and right now, that definition is missing.
Drew_Benton
Drew_Benton
Quote:
Original post by Anonymous Poster
Although, if he was missing that wouldn't he get undefined's for everything with 'SDL_'?


He would, except in the most common case that this is happening in another file, perhaps a header file, that does not yet use any SDL code. For example:

KeyBoardInput.h
#ifndef KB_H_#define KB_H_class KB_Input{   private:      vector <Uint8*> bufferedKeyArray;   public:      KB_Input();      ... member functions ...}#endif


KeyBoardInput.cpp
#include "KeyBoardInput.h"#include "SDL.h"KB_Input::KB_Input(){}... rest of member implementations ...
Rob Loach
Rob Loach
Quote:
Original post by Anonymous Poster
Off topic, but why did you use a vector, if SDL_GetKeyState(...) returns a snapshot of the program?
I'm assuming he'd be using a polling system for the input so that he can buffer the input in order to be able to get more then just three key presses at a time.
Rob Loach [Website] [Projects] [

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.