Sign in to follow this  
fotogames

Visual C++ 2008 Question

Recommended Posts

Hello everybody, I have a question. I made a little game, which runs fine on my pc. But when i try to run it at school, it gives an error (which i unfortunately forgot, i'll write it down next monday). I think the cause of the error is the fact that i use windows 7 and at school they only have xp. Does that make any difference when compiling? Or could it also be that, because i'm using VC++ 2008, .Net framework has to be installed, which isn't installed at school? Because I thought apps made with C++ don't need anything beside the DLL's you use to make your program. Thanks in advance!

Share this post


Link to post
Share on other sites
No, you don't need to compile any different.
it's probably the vs 2008 Redistributable Package(http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en) that you need (and maybe also the .net framework).

Quote:
Because I thought apps made with C++ don't need anything beside the DLL's you use to make your program.

yes, but are you sure you included all dll's? VS will load automatically some dll's who are located in system32/install folder.

Share this post


Link to post
Share on other sites
well i'm not sure, the only things i included in my source code are:
<SDL.h>
<string>
<ctime>
<math.h>

when i tried it at school, i only included the SDL.dll file. I'm kinda disappointed in the VC++ 2008 package, because i thought it was "windows version independant", but apparently, it isn't :(

Ok, i just tried it my sister's xp pc (i know i should've done that earlier) and it works. so it must be something with school. maybe something with service packs or something

[Edited by - fotogames on March 20, 2010 6:47:49 AM]

Share this post


Link to post
Share on other sites
you could check your debug output, it shows all dll that are loaded.
http://i40.tinypic.com/1pgz07.jpg
the red arrow shows the point when sdl.dll is loaded and as you can see, there is a lot more loaded so one of the dll's is missing (or has the wrong version) at the pc at your school.

about the VC++ 2008 package, it is windows independent but you need to have the redistributable (and/or .net framework) installed witch is available for any windows version.

Share this post


Link to post
Share on other sites
Yeah, but you'll have to install that package first for the app to work. And since i'm not admin at school, well, i can't install stuff like that i think. And why does VC++ include so many libraries? i though sdl was all i needed.

Share this post


Link to post
Share on other sites
[quote]
Yeah, but you'll have to install that package first for the app to work. And since i'm not admin at school, well, i can't install stuff like that i think. And why does VC++ include so many libraries? i though sdl was all i needed.
[quote]
The terminology you're using ("VC++ includes so many libraries..") isn't exactly correct. What you really mean to ask is why the program you wrote using VC++ depends on so many libraries.

The answer to this is because the program is written in C++ -- it has very little to do with Visual Studio, in fact. All C++ programs require a runtime library to support them; this library implements all the standard C and C++ functionality you have used in your program. Things like printf(), std::cout, malloc, new, et cetera. Without this support library, you program cannot run.

Because so many programs (every C++ program in fact) need this library, the most optimal way to provide it with a DLL, so that all programs may share one copy of it and they will all benefit from bug fixes and security patches to that library. The minor downside to this is that that library must be installed if it is not present (and there are actually several versions of it corresponding to versions of compiler toolchains that support various revisions of the language, et cetera).

This means in an environment where you cannot install the library -- like school -- you either have to get somebody to install it for you or take the option of static linking the runtime library. This option is generally not as ideal because it makes your executable larger and does not allow your executable to benefit from the aforementioned bugfixes and security patches.

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