• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
ildave1

Setting up SDL for Visual C++ 2005

16 posts in this topic

Gamedevers, Hey fellas, I am having a rough time making sure that im setting SDL up correctly for Visual C++ 2005 'Beta' edition. I copied the two *.lib files to my windows\system32 directory. I copied the two *.lib files to C:\Program Files\Microsoft Visual Studio 8\VC\lib I copied the header files to C:\Program Files\Microsoft Visual Studio 8\VC\include\SDL From what I Imagine is correct... I found that you need to actually let the software know about these two files, so I started a new project and looked around in the settings a bit. I found that if you go to the properties page, and down to Linker>>Input, you find "Additional Dependencies". Is that the correct place to put in sdl.lib and sdlmain.lib? When I attempt to do a quick compile of: #include <SDL/SDL.h> #include <iostream> using namespace std; int main() { return 0; } It gives me this error: Linking... LINK : fatal error LNK1104: cannot open file 'uuid.lib' Thanks for the help in advance.
0

Share this post


Link to post
Share on other sites
Copying static libraries into system32 folder is unnecessary, its DLLs that can go in there.

Anyways it appears you need the MS Platform SDK (required for win32 apps).

Once you've obtained that you must follow these instructions.

After which

create a project, then set-up the project settings for SDL:

C/C++ --> General --> Additional Include Directories = < insert sdl include directory >

Linker --> General --> Additional Library Directoires = < insert sdl library directory >

Linker --> Input --> Additional Dependencies = SDLmain.lib SDL.lib

You can also setup SDL include/library directories to be always set like you do for the platform sdk given in the instructions at the link above.
0

Share this post


Link to post
Share on other sites
Your system32 directory isn't the place to put lib files I don't think, and I wouldn't really put 'em in visual studio's directory either. Personally, I have mine in the program files directory, like this:

"c:\Program Files\SDL\include\"
"c:\Program Files\SDL\lib"


Then in Visual Studio 2005, you need to go to the Tools>Options menu, and under Projects and Solutions>VC++ Directories, you add those two directories...

Set Include Files to "c:\Program Files\SDL\include\" and
set Library files to "c:\Program Files\SDL\lib".

If you actually meant that you're using Visual C++ 2005 Express Edition (Beta 2), then there's a bug where doing the above isn't possible...it doesn't offer a way to set the directory in the options. What you need to do instead is to edit a text file. Assuming you installed VC++ Express to Program Files, you need to edit this file:

"c:\Program Files\Microsoft Visual Studio 8\VC\vcpackages\VCProjectEngine.Dll.Express.Config"

and when you're done editing that file, you need to DELETE the file below or your changes won't work:

"c:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\VCExpress\8.0\VCComponents.dat"

You may need to change "Administrator" in that path to whatever your login name is. Once you've edited the file and deleted that .dat file, you have to restart Visual C++.

Editing the VCProjectEngine.Dll.Express.Config file should be easy enough to figure out, but just in case...I'll show you a section of mine where I've added SDL, DirectX 9.0c, and the Platform SDK:

<Directories
Include="c:\Program Files\SDL\include;c:\Program Files\Microsoft DirectX 9.0c SDK (June 2005)\Include;c:\Program Files\Microsoft Platform SDK\Include;$(VCInstallDir)include;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include"
Library="c:\Program Files\SDL\lib;c:\Program Files\Microsoft DirectX 9.0c SDK (June 2005)\Lib\x86;c:\Program Files\Microsoft Platform SDK\Lib;$(VCInstallDir)lib;$(VCInstallDir)PlatformSDK\lib;$(FrameworkSDKDir)lib;$(VSInstallDir);$(VSInstallDir)lib"
Path="c:\Program Files\Microsoft Platform SDK\Bin;$(VCInstallDir)bin;$(VCInstallDir)PlatformSDK\bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);$(VSInstallDir);$(PATH)"
Reference="$(FrameworkDir)$(FrameworkVersion)"
Source="c:\Program Files\Microsoft Platform SDK\src\crt;$(VCInstallDir)crt\src"
/>


Once again, remember to delete VCComponents.dat when you're done editing!

As for the linker error that you got, I'd say its because either you haven't installed the Platform SDK, or you haven't set up the paths to the include and lib files for it. uuid.lib is from that Platform SDK. Check out this FAQ on how to install it for Visual C++ 2005 Express.

http://lab.msdn.microsoft.com/express/visualc/usingpsdk/default.aspx



There's a little bit more to getting SDL working, but this reply is already getting quite long, so I'll just quickly tell you. In your project's settings, you need to change the Runtime Library to Multi-threaded DLL which should be under C/C++>Code Generation. And if I remember right, for SDL, you can't just use "int main()", you need to add the parameters for the command line arguments, like this:

int main(int argc, char *argv[])

Then of course you need to add sdl.lib sdlmain.lib to the Additional Dependencies section of the Linker settings.

I actually made a project wizard to setup an SDL project automatically, 'cause it's quite a bit of work. Unfortunitly I have released it, but maybe I will someday. oh well...I'll bookmark this thread in case you need any other help. Good luck.
0

Share this post


Link to post
Share on other sites
One problem with some of the above methods: in VC 2005, you can't set additional include directories! Oh, and you don't need the Platform SDK to compile (at least I don't). Here's how I did it: copy the include/lib files to their proper directories in the installation, then in the project properties dialog, go to Configuration Properties->Input and add in sdlmain.lib and sdl.lib in the Additional Dependencies and add uuid.lib to the Ignore Specific Library field. Then, go to the C/C++ tree and select Code Generation, and change the Runtime Library to Multithreaded DLL.

That should work out for ya.
0

Share this post


Link to post
Share on other sites
Gamedevers,

I want to thank you all for your prompt response to this issue.

It's fixed, and I am now working through some tutorials from http://sol.planet-d.net/gp/index.html

This is what I didn't do (for future reference)
¤ Change Runtime Library to 'Multithreaded DLL'
¤ Ignore Specific Library -> 'uuid.lib'
¤ Placing SDL.DLL within the Visual Studio 8 Directory

Thanks for the help everybody!
0

Share this post


Link to post
Share on other sites
i can get it to work on Visual C++ 2005!

i keep on getting this error message:

------ Build started: Project: vtest, Configuration: Debug Win32 ------
Linking...
LINK : fatal error LNK1561: entry point must be defined
Build log was saved at "file://c:\Documents and Settings\Alan\Desktop\vtest\vtest\Debug\BuildLog.htm"
vtest - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
0

Share this post


Link to post
Share on other sites
When I try to use SDL_opengl.h, it keeps saying that "cannot open windows.h". I assumed that the windows SDK would fix that, but it still doesn't work. What am I missing?
0

Share this post


Link to post
Share on other sites
Quote:
Original post by n00body
When I try to use SDL_opengl.h, it keeps saying that "cannot open windows.h". I assumed that the windows SDK would fix that, but it still doesn't work. What am I missing?


It sounds like you didn't install the SDK properly. Try making a blank project and including <windows.h>, and it should fail. The header search paths probably just need to be set up properly.
0

Share this post


Link to post
Share on other sites
"Compiling...
SDL_teste.cpp
Linking...
LINK : fatal error LNK1561: entry point must be defined"

#include "SDL.h"   /* Todas as aplicações SDL precisam deste cabeçalho */
#include <stdio.h>

int main(void) {

printf("Initializing SDL.\n");

/* Inicializa padrões, Vídeo e Audio */
if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) {
printf("Não foi possível inicializar SDL: %s.\n", SDL_GetError());
exit(-1);
}

printf("SDL inicializada.\n");

printf("Terminando SDL.\n");

/* Termina todos os subsistemas */
SDL_Quit();

printf("Terminando....\n");

exit(0);
}


Anyone can help me??

Im with the libs linked, with uuid.lib ignored, with /MD and with no precompiled header.

Thanks!

0

Share this post


Link to post
Share on other sites
I found the problem....

I have to set the CONSOLE subsystem.

And then, use the main like this: "int main(int argc, char *argv[])"

"int main()" does not work.

;)
0

Share this post


Link to post
Share on other sites
I had a really difficult time with the SDL release and Visual Studio 2005 SP1.

I kept getting really annoying manifest errors when the debugger attempted to use/load the SDL.dll, and I spent too much time trying to track down these errors online.

The only workaround that immidiately fixed up these issues was to build the SDL source in VS2005.

hth,
0

Share this post


Link to post
Share on other sites
Quote:
Original post by n00body
When I try to use SDL_opengl.h, it keeps saying that "cannot open windows.h". I assumed that the windows SDK would fix that, but it still doesn't work. What am I missing?




I've got the same problem. I lloked into the VC/Includes directorie and it's just missing. No "windors.h" file. They aren't GL libraries too, so I think it could be related to the "Express" think (My guess is that in the free relase the just missed many libraries). Does anyone know how to fix it? I'm just trying to move from VC++ 6 to the 2005, but my projects don't work 'cause of that...


Thank you
0

Share this post


Link to post
Share on other sites
Before using SDL, make sure you have the latest version of Visual Studio with the latest service pack installed and the platform SDK installed and configured.
0

Share this post


Link to post
Share on other sites
Well...

first, thanks to lazy foo and his tutorials, which made me learn SDL.

Now that I can run my old project in VC++ 2005, SDL_image seems to have forgot how to load an jpg...

loadedImage = IMG_Load( "Data/secsi.jpg" );

then loadedImage is just NULL u.u

(I'm getting off topic, no? should I open a new thread? xDDDD)
0

Share this post


Link to post
Share on other sites
Quote:
Now that I can run my old project in VC++ 2005, SDL_image seems to have forgot how to load an jpg...

loadedImage = IMG_Load( "Data/secsi.jpg" );

then loadedImage is just NULL u.u

Try moving where the data folder is. The working directory may be different than where you are used to in VS 6.0. Your working directory is by default I think the same as where the source files are. That is where it is for me but I am not sure if I moved anything.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Atridas
Well...

first, thanks to lazy foo and his tutorials, which made me learn SDL.

Now that I can run my old project in VC++ 2005, SDL_image seems to have forgot how to load an jpg...

loadedImage = IMG_Load( "Data/secsi.jpg" );

then loadedImage is just NULL u.u

(I'm getting off topic, no? should I open a new thread? xDDDD)


I realize this is an old thread, but I recently had the exact same issue, and found a solution. Chances are you are missing jpeg.dll on your system, which is included as part of the binary download of SDL_image from the SDL_image download page

You either need to include jpeg.dll in the same folder as your executable, or could put it somewhere "visible" to applications on your system, like in the windows\system32 folder.

Hope this helps anyone else that may be encountering the same issue. Sometimes SDL is a little too good at failing gracefully, and in this situation it simply doesn't load in the image...sadly it doesn't return an error code that I can see, or any way to tell that it happened because the jpeg.dll file wasn't found.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0