• 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
subflood

linking SDL in Visual C++ 2005

12 posts in this topic

Hello, I just download Visual C++ 2005 Express Edition Beta. I'm not sure how to setup the linker for SDL and OpenGL. Anyone have experiance with this product?
0

Share this post


Link to post
Share on other sites
In the older versions of visual studio (specifically VS.NET 2003) you would do this.


Click: Tools->Options
Select: Projects->VC++ Directories
Add an entry for the SDL installation location (add for src, lib, header dirs etc..)

Now after you create your project:
Right click your project icon (after you open it in the right hand scrollable box) and select properties.

Select the tab called "Librarian" or "Linker" and add an entry for your specific SDL dll file (usualy the dll name + ".lib") in the "Additional Dependancies" box.


Now you can include SDL specific headers and call on them without getting link errors.

g/l
0

Share this post


Link to post
Share on other sites
Now I'm getting:

main.obj : error LNK2005: _SDL_main already defined in game.obj
LINK : fatal error LNK1104: cannot open file 'uuid.lib'
0

Share this post


Link to post
Share on other sites
Quote:
main.obj : error LNK2005: _SDL_main already defined in game.obj
LINK : fatal error LNK1104: cannot open file 'uuid.lib'


LINK : fatal error LNK1104: cannot open file 'uuid.lib'
This means your compiler cant find/open uuid.lib.

Already defined means you don't have your files correctly setup and its getting redefined or something. Most likely its defined in game.cpp or whatever object that points to.
0

Share this post


Link to post
Share on other sites
Guys, it's Beta. I had the same issues. I think SDL just doesn't work under VC8 yet. But in the future it'll be great. Like You can download custom templates and packs, like Dev-C++, but under the wide spread usability of VC. I only got VC7 becasue SDL_gfx had problems with Mingw and ahted it at first becasue I was hooked on DevPaks.
0

Share this post


Link to post
Share on other sites
1. Download SDL 1.2.8 and extract it to a location for it to stay in. (C:\Program Files\SDL 1.2.8).

2. Since VC++ is still beta, you are not able to set directories yet. Instead, you must include the header file from the complete path:
#include "C:\\Program Files\\SDL-1.2.8\\include\\SDL.h"
3. Now since you can't set directories and you need to add in library files, you must add those library files to the project. Right click on your project in the 'Solution Explorer' and choose "Add->Existing Item..." Now navigate to the /lib folder for SDL and add in the the SDL.lib and SDLMain.lib. Hit No on the new dialog, or if you hit Yes, then hit cancel.

4. Now go to "Project->Properties", "Linker->Input", and type in "uuid.lib" in the field that says "Ignore Specific Library".

5. Copy the SDL.DLL into your Debug/Release folders so it can be found when you run it. Everything should work fine now. Here's my code that I made for this test:

#include "C:\\Program Files\\SDL-1.2.8\\include\\SDL.h"

Uint8 *g_Keys = 0;

bool g_Done = 0;

int g_Width = 640;
int g_Height = 480;
int g_BPP = 32;

int g_Flags = SDL_DOUBLEBUF | SDL_HWSURFACE;

SDL_Surface* g_Screen;

SDL_Rect Dest;

bool Initialize()
{
Dest.x = 300;
Dest.y = 200;
Dest.w = 100;
Dest.h = 100;

return true;
}

void ProcessEvents( SDL_Event &event )
{
if ( event.type == SDL_QUIT )
g_Done = 1;
}

void Update()
{
g_Keys = SDL_GetKeyState( 0 );

if( g_Keys[ SDLK_ESCAPE ] )
{
g_Done = 1;
}
}

void Draw()
{
SDL_FillRect( g_Screen, &Dest, 0x00FF00 );
}

void Deinitialize()
{
}

int main(int argc, char *argv[])
{
if ( SDL_Init(SDL_INIT_VIDEO) < 0 )
{
printf("Unable to init SDL: %s\n", SDL_GetError());
return -1;
}
atexit(SDL_Quit);

if( !Initialize() )
{
return -1;
}

if ( NULL == SDL_SetVideoMode( g_Width, g_Height, g_BPP, g_Flags ) )
return -1;

g_Screen = SDL_GetVideoSurface();

while( g_Done == false )
{
SDL_Event event;
while ( SDL_PollEvent(&event) )
{
ProcessEvents( event );
}

SDL_FillRect( g_Screen, NULL, 0x000000 );

Update();
Draw();

SDL_Flip( g_Screen );
}

Deinitialize();
SDL_Quit();
return 0;
}







If anyone needs any help with what's been gone over feel free to ask [wink]. Good luck!
0

Share this post


Link to post
Share on other sites
how'd u figure out that uuid.lib thing, the rest seems obvious.

edit: nvrnmd, in errors. When I was trying, I tried to do it the same way they say to do the Platform SDK
0

Share this post


Link to post
Share on other sites
Visual C++ 2005 Beta 2 works just fine with setting directories up, its under Tools | Options...

and then the Projects and Solutions item on the left, VC++ Directories, as for linking you just need to goto project options, the linker, then input, and add SDL.lib and SDLmain.lib to the additional dependies box.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by neodingo
Visual C++ 2005 Beta 2 works just fine with setting directories up, its under Tools | Options...


The OP and I are using the express ediitons [wink] I checked back here to post this quote for anyone else using the express edition on how to fix this:

Quote:
Note: For Beta 2, you cannot set the Visual C++ Directories in the Options dialog of Visual C++ Express Edition. To work around this issue, you can update the Visual C++ Directories by modifying the VCProjectEngine.dll.express.config file located in the \vc\vcpackages subdirectory of the Visual C++ Express Edition install location. Please make sure that you also delete the file "vccomponents.dat" located in the "%USERPROFILE%\Local Settings\Application Data\Microsoft\VCExpress\8.0" if it exists before restarting Visual C++ Express Edition.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Yamian
I tried to do it the same way they say to do the Platform SDK


I did that VCProjectEngine.dll.express.config with SDL and it didn't seem to work...
0

Share this post


Link to post
Share on other sites
Yea I have tried it out last night and it did not work for me either. The only fix I can find is to add those paths to each project though the project settings. You will have to add in the header paths manually to the 'Additional Include Directories' under Project->Properties->C/C++->General then do the same for the Additional Library Directories under Linker->Input. Beta products...[headshake] Oh well, it's well worth it [wink]
0

Share this post


Link to post
Share on other sites
Just copy uuid.lib to C:\Program Files\Microsoft Visual Studio 8\VC\lib. It should work.
0

Share this post


Link to post
Share on other sites
Hey guys I tried the thing where you ignore uuid.lib - that is pretty good stuff since finally I can compile + link using the VC 2005 BETA 2. I also ignore some other lib called libcd.lib. Hopefully it does not do much although I notice strange behaviour using glui over opengl (the graphics stop when I move the mouse off the little glui window) - yes unfortunately I am not aware of the SDL - but your discussion at least solved one of my problems - cheers.
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