including SDL into a program
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?
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.
The license won't let you have the complete SDL embedded in your app.
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"?
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's Uint8. But incase you don't have it:
I'm not sure if the Uint64 was supported everywhere, though.
C++
typedef unsigned char Uint8;typedef unsigned short int Uint16;typedef unsigned long int Uint32;typedef unsigned long long int Uint64;
I'm not sure if the Uint64 was supported everywhere, though.
C++
Quote:Original post by 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?
Also, try:
#pragma comment(lib, "SDLmain.lib")#pragma comment(lib, "SDL.lib")
I think you are missing the 'main' one. It's the one that defines SDL_Main and other things, among which may be Uint8.
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.
Quote:Original post by 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.
Good point.
Although, if he was missing that wouldn't he get undefined's for everything with 'SDL_'?
C++
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 ...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement