Redistribution hell.

Started by
29 comments, last by Ezbez 16 years, 3 months ago
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.
Advertisement
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.
Neither worked.
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.
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]
But you were so close! Don't give up yet! All you need to do is link your project with the SDL files that you've compiled. That should be it.

[Edited by - Ezbez on January 6, 2008 4:12:45 AM]
But I'm content. In fact, Code Blocks has a lot of really neat features and by default (I think) statically links some of the libraries for me. The only dlls I needed were the ones with SDL in the name--aside from "libfreetype-6.dll". There's really no reason for me ever to code in Visual Studio again, and good reddens!
But what happens if you run into a problem with Code::Blocks? Will you go onto Dev-C++? Eventually you will run out of IDEs and compilers! You need to be able to solve the problems rather than just sidestepping them - and this problem you were already five sixths of the way done.
For SDL you need to dynamically link with the runtime library. This is stated somewhere in a Readme.txt or other file.

For distributing applications compiled with Visual Studio 2005/2008 you also need to redistribute the appropriate runtime libraries. For 2005 there is a Redistributable package which will install the appropriate dlls into WinSxS. I don't know whether there is such a package for the VS 2008 yet.

Another microsoft approved way is to simply copy the C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT folder into your application folder. (You still need to include the SDL dlls separately). AFAIK having the runtime dlls in this subfolder only works for Vista and XP. I'm not 100% sure if it works for 2000 but it will definitly not work for 98. Instead of having the runtime dlls in this subfolder one could copy them directly do the application folder. This will definitly also work on 2000 an probably also on 98. This is how Need For Speed Pro Street does it for instance.

One problem I discovered when using VS 2008 and SDL is that somehow the compiler generates a manifest file which also lists the VC++ 2005 runtime libraries as a dependency. I don't really know why that is happening (maybe because SDL was compiled with 2005?). So it seems you would have to also include the VS 2005 dlls alogn with the VS 2008 dlls when making SDL programs with 2008.
I also tried to not embed the manifest into the exe and them manually edited it removing the dependency on VC++ 2005 dlls and it seemed to work.
Ezbez, I would be more fervent to fix my problem with VS if I actually liked it more than code blocks. Code Blocks is awesome! There's really no reason for me to go back. And I'm not just saying this because I'm lazy. I'm willing to work hard at what I like.

Trenki, thanks for the info. I'll try to remember if I ever go back. But maybe SDL will update with VS9. In fact, I'm surprised they haven't already.

This topic is closed to new replies.

Advertisement