How do I get SDL to be found by VC++ 2008 Express?

This is a discussion on How do I get SDL to be found by VC++ 2008 Express? within the C Programming forums, part of the General Programming Boards category; The only thing I want SDL for is just fullscreen mode and vsync, nothing else. I attempted to get SDL ...

  1. #1
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582

    Question How do I get SDL to be found by VC++ 2008 Express?

    The only thing I want SDL for is just fullscreen mode and vsync, nothing else. I attempted to get SDL started but I only get a "fatal error C1083: Cannot open include file: 'SDL.h': No such file or directory" message. Comment out the include and everything runs as expected. It's as if SDL is unknown to VC++ 2008 Express. Where exactly should this file (and other related things be)?

    From there, all I need to do is define an SDL surface with SDL_Surface then use SDL_SetVideoMode to get fullscreen and vsync - 1024x768 at 32-bit color is widely supported and thus not an issue.
    High elevation is the best elevation. The higher, the better the view!
    My computer: XP Pro SP3, 3.4 GHz i7-2600K CPU (OC'd to 4 GHz), 4 GB DDR3 RAM, X-Fi Platinum sound, GeForce 460, 1920x1440 resolution, 1250 GB HDD space, Visual C++ 2008 Express

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,659
    Well you need to download the library and header files for a start.
    Simple DirectMedia Layer
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582
    I've already downloaded them (I forgot to mention that). I unzipped the ZIP file then copied the folder over to where my project is. I don't know how to get SDL.h to be "discovered" from there (I'm probably doing it wrong). I've tried putting the "SDL.h" file in my header files list but it had no effect. Afterall, I don't need to do that with "Windows.h" or any of the other standard C includes like string.h or math.h, of which I use often. I have a feeling there's some setting in VC++ 2008 Express that I need to update or I copied the folder to the wrong location (the complete folder with every file, including the documentation is included with their original file names).
    High elevation is the best elevation. The higher, the better the view!
    My computer: XP Pro SP3, 3.4 GHz i7-2600K CPU (OC'd to 4 GHz), 4 GB DDR3 RAM, X-Fi Platinum sound, GeForce 460, 1920x1440 resolution, 1250 GB HDD space, Visual C++ 2008 Express

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,659
    Somewhere in say project->settings->compiler, there is an option to
    - add additional paths to search for include files
    - add additional paths to search for libraries
    - add additional library names
    These you need to setup so the compiler can find your 3rd party includes and libraries.

    I'm sure there is some info on the libsdl site explaining these steps.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582
    Okay, so I supposedly got that going. With only SDL.h being included without any SDL_Init, SDL_Quit, and the like to go with it (just the bare include in other words), I was able to run my game. Upon attempting to start initializing SDL, I get these 3 errors, all otherwise the same:

    1>Platform Masters.obj : error LNK2019: unresolved external symbol _SDL_GetError referenced in function _InitializeDrawing
    1>Platform Masters.obj : error LNK2019: unresolved external symbol _SDL_Init referenced in function _InitializeDrawing
    1>Platform Masters.obj : error LNK2019: unresolved external symbol _SDL_Quit referenced in function _WinMain@16

    Those are SDL functions and all have "unresolved external symbol" errors, error LNK2019. What am I missing?
    High elevation is the best elevation. The higher, the better the view!
    My computer: XP Pro SP3, 3.4 GHz i7-2600K CPU (OC'd to 4 GHz), 4 GB DDR3 RAM, X-Fi Platinum sound, GeForce 460, 1920x1440 resolution, 1250 GB HDD space, Visual C++ 2008 Express

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,659
    Somewhere in say project->settings->compiler, there is an option to
    - add additional paths to search for include files (DONE)
    - add additional paths to search for libraries (TO DO)
    - add additional library names (TO DO)
    These you need to setup so the compiler can find your 3rd party includes and libraries.

    You've done step 1, now do the others.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  7. #7
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582
    I set the "Additional library directories" under the project settings at project > %s properties > configuration properties > Linker > General. The libraries and include files have been set as well in the tools > options > projects and solutions > VC++ Directories. I used the drop down menu to select "includes', set the folder containing the includes (include), used the drop down menu to select "libraries" then set the folder containing the libraries (lib). I've done those (before I posted my message showing the errors) and I still get those same errors. I just rechecked them too to see if they were included and correct.
    High elevation is the best elevation. The higher, the better the view!
    My computer: XP Pro SP3, 3.4 GHz i7-2600K CPU (OC'd to 4 GHz), 4 GB DDR3 RAM, X-Fi Platinum sound, GeForce 460, 1920x1440 resolution, 1250 GB HDD space, Visual C++ 2008 Express

  8. #8
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,659
    Did you also set the name of the library that the linker should use as well?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  9. #9
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582
    Where do I set the name of the library and what would the name be? There are 3 files in the lib directory - sdl.dll, sdl.lib, and sdlmain.lib.
    High elevation is the best elevation. The higher, the better the view!
    My computer: XP Pro SP3, 3.4 GHz i7-2600K CPU (OC'd to 4 GHz), 4 GB DDR3 RAM, X-Fi Platinum sound, GeForce 460, 1920x1440 resolution, 1250 GB HDD space, Visual C++ 2008 Express

  10. #10
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,659
    I'm sure there is a FAQ at libsdl.org to explain all of this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  11. #11
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,651

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. VC express 2008
    By rikroll in forum C++ Programming
    Replies: 6
    Last Post: 08-01-2009, 10:32 AM
  2. No Input window for cin>> For Express 2008
    By surefall in forum C++ Programming
    Replies: 0
    Last Post: 04-21-2009, 11:55 AM
  3. C++ Express 2008 programs don't work on XP?
    By edomingox in forum C++ Programming
    Replies: 11
    Last Post: 10-24-2008, 03:10 PM
  4. VS 2008 Express with 2005 PSDK
    By Mario F. in forum Tech Board
    Replies: 2
    Last Post: 10-11-2008, 12:29 PM
  5. visual c++ 2008 express
    By manzoor in forum C++ Programming
    Replies: 2
    Last Post: 02-07-2008, 04:31 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21