Sign in to follow this  
absolute

Running a SDL project on another PC

Recommended Posts

My game compiles and runs fine on my PC, but when I try to run it on another PC I get this error "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem" I am using Visual C++ 2008 Express with SDL. I just need to compile the project with the Release config, and send the files created in the Release folder to the other PC to make it run, right? What else am I missing? Thanks.

Share this post


Link to post
Share on other sites
I'm guessing that on the other computer you don't have the required SDL .dll files that you do on the dev computer, which you made the game on?

Try throwing the .dll files that are needed for that game in the folder of that game, and try it on another machine that you know doesn't have any SDL .dll files in the system32 folder.

Good Luck!

Share this post


Link to post
Share on other sites
Ya I have the SDL.dll included in the folder. I also have:

#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")

in the main.cpp, instead of linking them in the project settings.

Share this post


Link to post
Share on other sites
I haven't worked with the express editions of VS but a problem that sometimes occurs with the non-express editions is the failure to include the visual studios runtime libraries. I forget the file but I believe it's msvcrt.dll or something similar.

A workaround is to go to your project property page -> C/C++ -> Code Generation -> then set runtime library to a non dll version.

I'm hoping the express edition works the same, I'm looking at the professional edition.

Hope that works!

Share this post


Link to post
Share on other sites
Quote:
Original post by Peter5897
I haven't worked with the express editions of VS but a problem that sometimes occurs with the non-express editions is the failure to include the visual studios runtime libraries. I forget the file but I believe it's msvcrt.dll or something similar.

A workaround is to go to your project property page -> C/C++ -> Code Generation -> then set runtime library to a non dll version.

I'm hoping the express edition works the same, I'm looking at the professional edition.

Hope that works!


I tried your workaround, but I get a bunch of errors when I compile now. They are relating to msvcrt.lib(MSVCR90) - error LNK2005, things like objects and classes already being defined. Was there anything else I was supposed to do? I tried the Multi Threaded and Multi Threaded Debug settings.

Share this post


Link to post
Share on other sites
I believe I ran in to that problem with my last SDL project and the solution I used was to go to project properties -> linker -> command line -> and under "additional options" add:

/NODEFAULTLIB:msvcrt.lib

I did a quick check with the old project and I get those LNK2005 errors without that line in. Unfortunately, a couple warnings pop up in one of sdl's library files after you add the command line argument. I remember doing a brief google search on how to get rid of those warnings but I was unable to find a solution.

Anyway, I hope that solves your problem!

Share this post


Link to post
Share on other sites
Quote:
Original post by absolute
My game compiles and runs fine on my PC, but when I try to run it on another PC I get this error

"This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem"

I am using Visual C++ 2008 Express with SDL. I just need to compile the project with the Release config, and send the files created in the Release folder to the other PC to make it run, right? What else am I missing?

Thanks.


There are two things that come to mind:

1) you're not redistributing the right version of MSVCRT<stuff>.dll
The 2008 version of VS has a different runtime.
There's a tool called "depends" or "dependency walker". If you load your exe in that app on the target PC it will tell you which DLLs are missing.
The missing DLLs on your target PC can probably be found in the system

Another way is to statically link the runtime, just like Peter5897 suggests. However, because the SDL lib is built agains the DLL runtime lib it already defines some runtime symbols (hence the LNK2005 errors)
One solution is to download the source of SDL and build it as a static lib and link that in your project.



2) Is the target PC or your dev PC running an x64 OS?
Though I'm not sure if this is also an issue with C++ or managed C++. I never tried.
I encountered problems in C# when leaving the build configuration to "ANY CPU". When you put it on "ANY CPU" the OS determines in which CPU mode (x64 or x86) it runs the application. This poses a problem when making calls to DLLs from another platform. For example, if the application runs in x64 mode, and you distributed and x86 DLL with that it crashes when calling that DLL. I remember the error being along the lines of "invalid page... bla bla, something", but the error might be different in C++ apps, I have no idea.

This is probably not actually your problem (just making wild guesses with the limited information here), but the solution is to explicity put the build configuration as x86.

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