Sign in to follow this  
Splinter of Chaos

Redistribution hell.

Recommended Posts

I've spent a little less than a month making my game (not that it's finished), and I'm the only one who can play it. I tried following one of the threads on this site: http://www.gamedev.net/community/forums/topic.asp?topic_id=406590, and the problem seems similar, but it didn't seem to have ever gotten resolved. I have tried including all the necessary dll files, but every time I included one, windows asked for another, like a mother who's never satisfied. I've gone to college, got a job, a wife, a family, what next? Oh, how could I have forgotten to get a dog? The last thing it said was "The ordinal 50 could not be located in the dynamic link library jpeg.dll.", and I didn't even try to fix that one. By the time I'd gotten that far, it had already made me add msvcp90.dll, msvcr90.dll, msjava.dll (why the hell?), jvm.dll, verify.dll... Crazy, I tell you! I'm thinking that we can all have a blind "Try this!" and "Well, I would..." session, but quicker would be if there's a way you guys can actually see my settings or something. Is there?

Share this post


Link to post
Share on other sites
Did you use "Release" build instead of "Debug" build? Do all the people you gave your game to have the framework you developed your game on (ex. .Net 3.5) ?

I think there is a program than can look up dependances for exe files but its name escapes me, perhaps someone else can shed some light.

Also, if your exe asks for so many DLLs that you don't even know about, this means there is something not right with either your build set up, or with the end-user's computer.

The msvcp90.dll sounds like a Visual Studio 2008 dll - you shouldn't need that in your final build... but it might be included in the debug (check your output window during debug build and you'll see it loads up a whole bunch of useless dlls). So again, make sure you're not giving them your debug build.

Share this post


Link to post
Share on other sites
I can verify it is in release mode. Partially because when I try to test the game outside VS, I go to the release folder.

I do have the program that looks up the dependencies. It said that only the Visual Studio dlls were missing. And it said some that the exe didn't even care about were missing, but it ran without them. The thing is, though, if I put ANY dlls in the file, it expects me to supply ALL the dlls. So that's pretty much my basis for whether it will run on someone else's computer. Or at least if it'll run on mine, there's a chance. If it won't, there's none.

"Do all the people you gave your game to have the framework you developed your game on (ex. .Net 3.5) ?"

I don't want them to have to.

"The msvcp90.dll sounds like a Visual Studio 2008 dll - you shouldn't need that in your final build... but it might be included in the debug"

Nope. I had to add it upon request by the program. But seeing as it does sound like a VS dll, I don't think I SHOULD need it, but apparently do?

Share this post


Link to post
Share on other sites
Welcome to one of the only true pains in the butt about visual studio 2005 and on.

Really short answer, copy the directory "Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT" to your programs working directory. Distribute your program with this folder and all of it's contents, and run program normally. [use Microsoft.vc80.net for usage of .net stuff, or the different versions, if you used some strange libraries and settings such as use of openMP. If you did not use anything outside of just straight c++, just the .crt version]. Run your program with this entire folder in your program's working directory. Note that this isn't a 'good' solution, but it works in many cases.

Sorta short answer, [and better answer], try downloading This, and running it on the target machine. It should clear up your problem.

Long answer can be found here [which will lead you likely to the same or a similar conclusion, but will educate you more about what is the problem and why it's there, and will give you an assortment of options with which to combat this stupid problem]

Let us know if it works. Btw, the keyword you're looking for is 'deployment', for future searches and questions [which will fetch you more relevant information from such sources as msdn and google].

[Edited by - Drigovas on January 2, 2008 5:25:41 AM]

Share this post


Link to post
Share on other sites
For the VS C/C++ runtime DLLs, another option is to change your project settings so the runtime is statically linked into your exe.

Go to Project Properties->C/C++->Code Generation and, with Release selected top right, change the runtime library option from /MTd to /MT.

Downsides are that your exe will be bigger, and once distributed, will not benefit from any updates to the runtime that MS may release (although to be fair, if you are distributing copies of these DLLs instead of getting the user to install the runtime package, this will be the case anyway).

Obviously this will not affect any other dependancies your project has.

Share this post


Link to post
Share on other sites
Quote:
Original post by Splinter of Chaos
"Do all the people you gave your game to have the framework you developed your game on (ex. .Net 3.5) ?"

I don't want them to have to.


Specifically (for the .NET Framework), you don't have a choice in this regard. Anything you develop on top of the framework, will only run on top of the framework. I'm talking "in the event" of, which might not apply in your case (and I'm guessing it doesn't).

Share this post


Link to post
Share on other sites
msvcp90.dll is a release DLL (the standard C++ library DLL in fact), the debug version is called msvcp90d.dll.
More details here: http://msdn2.microsoft.com/en-us/library/abx4dbyh.aspx

Share this post


Link to post
Share on other sites
Instead of including msvcr90.dll, msvcp90.dll and msvcm90.dll with your game, simply let your users run the official Visual C++ Runtime 2008 Redistributable. This will properly install the runtime DLLs into the WinSxS folder and should get any standard Visual C++ application running.

Just for clarity, the purpose of those DLLs is:
msvcr90.dll - Good ol' C runtime for Visual C++ 2008 programs. Contains the DLL versions of printf(), fopen(), malloc() etc.
msvcp90.dll - C++ runtime for Visual C++ 2008 programs. Mostly consists of the iostreams library and possible some codecvt tables.
msvcm90.dll - C++ runtime compiled as C++/CLI for .NET interoperability.

Any other dependencies are dependencies you introduced yourself (eg. by using libjpeg, opengl, directx or whatever). I know this doesn't help you at this point in time, but it's a good idea to keep track of these dependencies as you add them and never add even one of them to your system32 directory or anything. That way, if it runs on your PC, you know everything (minus the Visual C++ runtime) is there.

-Markus-

Share this post


Link to post
Share on other sites
Quote:
Original post by EasilyConfused
Go to Project Properties->C/C++->Code Generation and, with Release selected top right, change the runtime library option from /MTd to /MT.


This caused the fallowing error:
Quote:
1>------ Build started: Project: Oribits, Configuration: Release Win32 ------
1>Linking...
1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>msvcrt.lib(MSVCR90.dll) : error LNK2005: _isspace already defined in LIBCMT.lib(_ctype.obj)
1>msvcrt.lib(MSVCR90.dll) : error LNK2005: ___iob_func already defined in LIBCMT.lib(_file.obj)
1>msvcrt.lib(MSVCR90.dll) : error LNK2005: _fclose already defined in LIBCMT.lib(fclose.obj)
1>msvcrt.lib(MSVCR90.dll) : error LNK2005: _exit already defined in LIBCMT.lib(crt0dat.obj)
1>LIBCMT.lib(crt0init.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>C:\Documents and Settings\Owner\Desktop\Programming\C++\WorkSpace\Orbits\Oribits\Release\Oribits.exe : fatal error LNK1169: one or more multiply defined symbols found
1>Build log was saved at "file://c:\Documents and Settings\Owner\Desktop\Programming\C++\WorkSpace\Orbits\Oribits\Release\BuildLog.htm"
1>Oribits - 7 error(s), 1 warning(s)


Thanks for all the replies. I'm going through the Microsoft documentation right now. But something strikes me as odd. I've never had to download a MSVCP-crap thing whenever I've downloaded someone else's work. And distribution shouldn't be hard. VS should be able to simulate how my program will run on other computers and configure it so it'll run without hassle. I'd consider that a F**KING CORE FEATURE! The only reason I even use VS is because, as a last resort, I tried to set SDL up with it and unlike ALL OTHER IDEs, it worked! Hooking myself up with others should be just as easy has hooking others up with me. WHY THE F**K ISN'T IT?

Share this post


Link to post
Share on other sites
I've had your latest batch of errors after doing the same thing that you did (expect on VC++ 2005). I 'fixed' them by explicitly ignoring LIBCMT.lib. I think there were a couple more libraries that I had to ignore after LIBCMT, too. Ignoring them is in the linker settings, underneath where you link to a library.

Hardly a fix, and I have no clue why this happens. I was also using SDL, which might, I think, be a problem. Try recompiling SDL from source using the same settings as you're using for your project, if you have time or my above doesn't work.

Share this post


Link to post
Share on other sites
That made it compile, but I'll have to wait a while to test it...unless someone here would be willing to download the game, and tell me how it goes (assuming you don't have the dlls in your SYSTEM folder), I'd be very greatful.

Otherwise I have to wait until my sister goes to bed and use her computer.

Share this post


Link to post
Share on other sites
For embedding the dlls as static via compiler settings, I too got linker errors. But doing a simple "Rebuild Solution" made them go away.

Also, all of my programs that I made with VC run fine on my comp without screaming for extra dlls - does installing VC automatically install the require redistributables?

Share this post


Link to post
Share on other sites
Quote:
Original post by Splinter of Chaos
Thanks for all the replies. I'm going through the Microsoft documentation right now. But something strikes me as odd. I've never had to download a MSVCP-crap thing whenever I've downloaded someone else's work. And distribution shouldn't be hard. VS should be able to simulate how my program will run on other computers and configure it so it'll run without hassle. I'd consider that a F**KING CORE FEATURE! The only reason I even use VS is because, as a last resort, I tried to set SDL up with it and unlike ALL OTHER IDEs, it worked! Hooking myself up with others should be just as easy has hooking others up with me. WHY THE F**K ISN'T IT?


Anything prior to VS2008 DLLs are included in many apps for windows (and possibly in with WinXP's latest update), so most people already have them. That's probably why you're having a lot of problems now and why stuff you've downloaded always just worked.

Out of interest, have you tried static linking?

Share this post


Link to post
Share on other sites
Quote:
Original post by Koobazaur
Also, all of my programs that I made with VC run fine on my comp without screaming for extra dlls - does installing VC automatically install the require redistributables?
Yes, which is the whole root of this problem. Developers have additional concerns when running their program on a machine that has not had special things done to the project, or distributable files installed [which only need to be installed once]. Installing the IDE comes with these files, so the problem will not manifest itself on computers that have the ide installed.

And no, you're not out of luck. What all did you try from the msdn page on deployment for your specific language and IDE [such as the one linked to previously for vs2005 C++]? Also, did you use SDL or openGL, did you use a very recent build of directX, or anything else that would result in additional dependancies [sdl distributable dll's, openGL stuff that windows doesn't always play nicely with, or a re-install of directX respectively]. Also, is there anything that you are using in your program that you see as a possibility that the target computer can't handle [using RAW input sockets on an old windows version, for example]. What error is the target machine giving you.

Share this post


Link to post
Share on other sites
Language: C++
Dependencies: SDL, SDL_Mix, SDL_Image, SDL_TTF, SDL_Timer
Error message: "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."

The MSDN page was so technical and full of confusing details that I gave up.

I don't know how to link statically.

EDIT
I tried to compile the SDL source code myself, but I couldn't figure out how to do it. There are a bunch of files neatly placed into different folders and I just don't know how to make VS recognize all of them.

[Edited by - Splinter of Chaos on January 3, 2008 3:34:33 PM]

Share this post


Link to post
Share on other sites
Okay, here is a step-by-step breakdown of an easy but pretty crude deployment method for visual studio 2005 C++. This is starting with a fresh project without any weird settings in place in your previous attempts to deploy your application, such as attempting to enable static linking. [this is pretty much straight from the msdn site linked earlier]

Step 1: Create a folder, that we will call 'MyProject', and copy the release version of your project [the .exe] into that folder.

Step 2: Copy the SDL .dll's and .lib's into that same folder [without a sub-folder]. I'm pretty sure it's just SDL.dll [but it has been a long time since I had any contact with SDL. Things may have changed].

Step 3: Open the folder "Program Files\Microsoft Visual Studio 8\VC\redist\x86" [or an equivalent on your system] in a separate window.*** see bottom for a comment.

Step 3: Copy the folder "Microsoft.VC80.MFC" and "Microsoft.VC80.CRT" into the folder "MyProject" that contains your project. Note that you are copying the entire folders, not the contents of the folders.

Step 4: Copy any game assets that you're going to need into the correct places within 'MyProject'[this step depends on how you organize your game's resources. If you do not depend on any outside files, then this step is not taken]. These resources are things like textures, geometry, sounds, etc.

Step 5: Copy 'MyProject' to the target machine, and run the .exe inside.

This takes care of all the problems associated with VS2005 C++ deployment, anything else is the result of missing SDL dll's, something else missing, strange project/solution settings, or whatever. This works on any OS that supports manifest linking, which includes windows XP and on. Windows vista should actually include these redistributable files already in place as part of a past service patch [at least it does on my vista machine]. I actually can't find anywhere on SDL's site that says it even functions on vista though.. which may be a problem.

*** if you are deploying to a 64 bit environment, copy the same folders around, only take them from "Program Files\Microsoft Visual Studio 8\VC\redist\amd64" or "Program Files\Microsoft Visual Studio 8\VC\redist\ia64" instead.

Share this post


Link to post
Share on other sites
Didn't work, but that might be because I didn't see any "Microsoft.VC80.MFC". The other one was there, though.

EDIT
Instead of having this cluster [insert verb] for solutions, is there anyway I can post every scrap of information on my problem online for all to see? This is a terribly ineffective way at solving the problem. It's frustrating the I can't let others see the fruits of my labor, but the only thing that makes me want to give up is how difficult Microsoft is making this.

Share this post


Link to post
Share on other sites
The SVN source of SDL has a handy file titled "VisualC.html" which details how to build SDL from scratch with VC++ 5,6, or 7. I'm betting it works with 8 and 9 also (well, I have compiled it with 8, but not 9). Basically, you unzip the VisualC.zip folder and use the project file that it's got. Just make sure to change its settings to what you're now using.

Edit: I just want to add that I don't believe this is some Microsoft conspiracy out to make all us individuals pay, but rather an incompatibility between the compiler settings for the pre-compiled SDL files and the settings that you need to use to redistribute easily. The point being that I wouldn't blame Microsoft - or anyone - for this. I just wish it was more widely documented or known about.

[Edited by - Ezbez on January 4, 2008 3:47:52 PM]

Share this post


Link to post
Share on other sites
The instructions almost worked.

Quote:
1>------ Build started: Project: SDL, Configuration: Debug Win32 ------
1>Compiling...
1>SDL_dx5audio.c
1>c:\documents and settings\owner\desktop\programming\c++\sdl-1.2.13\src\audio\windx5\directx.h(81) : fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory
1>SDL_dx5events.c
1>c:\documents and settings\owner\desktop\programming\c++\sdl-1.2.13\src\video\windx5\directx.h(81) : fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory
1>SDL_dx5video.c
1>c:\documents and settings\owner\desktop\programming\c++\sdl-1.2.13\src\video\windx5\directx.h(81) : fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory
1>SDL_dx5yuv.c
1>c:\documents and settings\owner\desktop\programming\c++\sdl-1.2.13\src\video\windx5\directx.h(81) : fatal error C1083: Cannot open include file: 'dsound.h': No such file or directory
1>Generating Code...
1>Build log was saved at "file://c:\Documents and Settings\Owner\Desktop\Programming\C++\SDL-1.2.13\VisualC\SDL\Debug\BuildLog.htm"
1>SDL - 4 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I wonder if this has something to do with a file no longer being used or something. But it seems like someone out there is determined to keep anything I make under wraps.

I'm really only asking this as a last resort, but would it be possible for someone else to compile my code and send me back the files for me to distribute? I'm not asking for volunteers yet, but I'm preparing for a plan B.

Share this post


Link to post
Share on other sites
You need to have the DX SDK installed. Get it off of MSDN.

I do have them compiled on VC++ 2005. It should work with 2008 also, but I haven't tested. Try this link. If that doesn't work, PM me an email I can send it to.

Share this post


Link to post
Share on other sites
Answering for the good of Googlers:

For the DirectX SDK Make sure that you add it's Include, Bin\x86, and Lib\x86 subdirectories in Tools->Options->Project and Solutions->VC++ Directories under the Include, Executable, and Library files pull-down-subsections. Doing this tells VC++ where to look for .h, .dll, and .lib files, respectively. It's a necessary step for using any library. It's probably installed somewhere like this:
C:\Program Files\Microsoft DirectX SDK (August 2006)\Utilities\Bin
For the Bin and Lib ones, use either x86 or x64 depending on what you're targeting.

And I made a mistake with the files above. I needed to include SDLmain.lib, also. New link. And make sure that you're linking to SDL.lib and SDLmain.lib, as well as putting SDL.dll in the .exe's directory. You can link to them by replacing the old ones in your SDL\lib directory.

Share this post


Link to post
Share on other sites
OK. I finally got SDL to compile, although the statically linked dlls you linked didn't work, or I used them wrong, but right now I don't care.

I'm at the point where I'd rather restart than make what I have work. If I rebuild my program with OpenGL or DirectX (which or both), should I not have any trouble? I'm hoping for OpenGL, personally.

EDIT
PROBLEM SOLVED!!!!!!!!!!!!!!!!!!!!

I can't say just how excited I am, my problem is solved.
All I had to do was give Microsoft the finger and download code::blocks, and configure it for SDL.

The game works!

[Edited by - Splinter of Chaos on January 5, 2008 6:18:47 PM]

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