Questions About VC++ 2005 Express

Started by
7 comments, last by GenuineXP 18 years, 2 months ago
I'm new to Microsoft's Visual Studio applications (except Visual C# 2005 Express Edition), but after using Visual C# and experimenting with Visual C++ I thought I'd like to use Visual C++ for game programming. I currently use the Code::Blocks IDE for C++ programming using SDL and OpenGL. My question is, can I do the same things using Microsoft Visual C++ 2005 Express Edition? How do I use libraries like SDL with VC++ 2005? I can't seem to find the usual "lib" and "bin" directories to copy the necessary files to. Also, how would I set up OpenGL from VC++? I'm really lost in this comprehensive IDE! Any help is appreciated. Thanks! :-)
Advertisement
I currently use the Code::Blocks IDE for C++ programming using SDL and OpenGL. My question is, can I do the same things using Microsoft Visual C++ 2005 Express Edition?

-Yes you can do the same thing with MSVC 2005 Express.


How do I use libraries like SDL with VC++ 2005? I can't seem to find the usual "lib" and "bin" directories to copy the necessary files to.

-You don't have to copy the files in the directories. You tell the IDE where the lib and binary files are.
In 2003 you go to
->tool
->Option
->Projects
->VC++ Directories
And i think you'll handle the rest yourself

Also, how would I set up OpenGL from VC++? I'm really lost in this comprehensive IDE!

-Sorry can't help on that one :(
Thanks for the help. I've managed to get a plain old console application working. I can already tell that I like this IDE... but I still have no clue how to setup SDL or any other library for that matter. I browsed through the options and even found a "VC++ Directories" dialog, but I couldn't do anything from there; there were only two drop down boxes and I don't understand what they're meant for.

Hmm...
When you download SDL, install it in the c:\program files\SDL

Under VC++ you go here like i told you

Image Hosted by ImageShack.us

In the top right corner tell what directory you'd like to "link" the IDE (VC++) to. So if you want the lib files of SDL you select Library files.

Then click on the new line button (the one my ugly arrow is pointing to) and a blank line will apear under. Then click on the ... button and go find the directory that contain the lib files of SDL. Do the same thing for the include files (Don't forget to tell your linking to include files in top right corner)
I have it working now, I think.

That's exactly the same dialog I found before... except there were no buttons and no list of items to add! It was just blank!

Well, I had the Beta 2 version of VC++ Express installed. I removed everything and updated and, sure enough, the dialog looks just like yours now.

Thanks for the help. :-)
Yikes! I'm still having trouble getting SDL to work with VC++. Just for reference, this is the code I'm working with. It's the simplest setup I could throw together.

#include <SDL.h>SDL_Surface* _pScreen;bool _bQuit = true;int main(int NumArgs, char* Args[]){	SDL_Init(SDL_INIT_VIDEO);	_pScreen = SDL_SetVideoMode(		640,		480,		32,		SDL_DOUBLEBUF | SDL_HWSURFACE //| SDL_FULLSCREEN	);	SDL_Event Event;	while(_bQuit)	{		SDL_PollEvent(&Event);		switch(Event.type)		{			case SDL_KEYDOWN:			{				switch(Event.key.keysym.sym)				{					case SDLK_ESCAPE:					{						_bQuit = false;						break;					}					default:					{						break;					}				}				break;			}			default:			{				break;			}		}	}	SDL_Quit();	return 0;}


I added the appropriate directories for SDL to the project. In my case, they're "Z:\SDL\lib" and "Z:\SDL\include". I get these build errors.
------ Build started: Project: SDL Application, Configuration: Debug Win32 ------Compiling...main.cppLinking...main.obj : error LNK2019: unresolved external symbol _SDL_Quit referenced in function _SDL_mainmain.obj : error LNK2019: unresolved external symbol _SDL_PollEvent referenced in function _SDL_mainmain.obj : error LNK2019: unresolved external symbol _SDL_SetVideoMode referenced in function _SDL_mainmain.obj : error LNK2019: unresolved external symbol _SDL_Init referenced in function _SDL_mainMSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartupC:\Documents and Settings\Sean\My Documents\Visual Studio 2005\Projects\SDL Application\Debug\SDL Application.exe : fatal error LNK1120: 5 unresolved externalsBuild log was saved at "file://c:\Documents and Settings\Sean\My Documents\Visual Studio 2005\Projects\SDL Application\SDL Application\Debug\BuildLog.htm"SDL Application - 6 error(s), 2 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Any ideas? What do I need to do to fix this problem? Thanks for all of your help!

Oh! I created this project as a Win32 Console Application. I didn't modify any project settings other than the include and library directories for SDL.
You have to add SDL's .lib files to your project. They're in the LIB directory.

The two files are sdl.lib and SDLmain.lib. Just add them to your project and you'll be good to go.

Also, make sure that sdl.dll is in your project directory or else SDL will complain.
Well, I'm getting further. :-) However, I still have one build error!
------ Build started: Project: SDL Application, Configuration: Debug Win32 ------Linking...LINK : fatal error LNK1104: cannot open file 'uuid.lib'Build log was saved at "file://c:\Documents and Settings\Sean\My Documents\Visual Studio 2005\Projects\SDL Application\SDL Application\Debug\BuildLog.htm"SDL Application - 1 error(s), 0 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

What's this mean?
This is sorta strange. I finally got the program to compile and run successfully, but I had to add a library path. I searched for "uuid.lib" on my system and found it in the "C:\Program Files\Microsoft Platform SDK\Lib" directory. (It also found several copies in different subdirectories, including "AMD64" and "IA64".)

This directory is only there because I downloaded and installed the Platform SDK awhile ago. Where should it have been? Isn't that something that should have been in the Visual Studio directories? I also received a strange warning about this, but it seemed to work just fine.

This topic is closed to new replies.

Advertisement