Windows Executables

I have an executable that does not work on windows machines without VC.
It says it can not find certain DLLs. Is there any way that I can fix
this in my compile?

Cliff

Just place the DLL’s in your windows sytem directory or in the same
directory as the executable. If the program works under VC than that means
you have the right DLL somewhere on your hard-disk.

Peter> ----- Original Message -----

From: kernel@seul.org ()
To: SDL
Sent: Thursday, July 12, 2001 5:15 PM
Subject: [SDL] Windows Executables

I have an executable that does not work on windows machines without VC.
It says it can not find certain DLLs. Is there any way that I can fix
this in my compile?

Cliff

Probably not, but you could fix your installation to ship with recent
versions of msvcrt.dll and/or whatever else it wants.–

Olivier A. Dagenais - Software Architect and Developer

wrote in message
news:Pine.LNX.4.30.0107121113590.22497-100000 at moria.mit.edu

I have an executable that does not work on windows machines without
VC.
It says it can not find certain DLLs. Is there any way that I can
fix
this in my compile?

Cliff

I have an executable that does not work on windows machines without VC.
It says it can not find certain DLLs. Is there any way that I can fix
this in my compile?

Probably. What DLLs does it say it’s missing???

Cheers,
-Josh–
“Ittai koko wa doko nan da!”

It’s (probably) these:

msvcpp60.dll
msvcrt.dll

(plus a d at the ned of the file name if you compiled in debug mode).

Just find these files on your computer and copy them into the directory with
your exe when you want to distribute it on another computer.>From: skia at skia.net

Reply-To: sdl at lokigames.com
To: SDL
Subject: Re: [SDL] Windows Executables
Date: Thu, 12 Jul 2001 13:46:28 -0400 (EDT)

I have an executable that does not work on windows machines without VC.
It says it can not find certain DLLs. Is there any way that I can fix
this in my compile?

Probably. What DLLs does it say it’s missing???

Cheers,
-Josh


“Ittai koko wa doko nan da!”


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

I have an executable that does not work on windows machines without VC.

That means that the executable is linked to use debug runtime libraries.
The libraries that can not be found are *D.DLL libraries, which are part
of VisualC, but not normal Windows.

The best option is to recompile the program so that it uses non-debug
runtime libraries. Usually this is done by selecting Release configuration
as active configuration. You may have to check that project settings are
set to use non-debug runtime libraries.

Not only you will need to make sure the program is linked to correct
runtime libraries, you will also need to do the same for all libraries
you link your program with. Basicly this happens from library project
just like for your own program. Make sure you compile the library with
Release configuration and that the release configuration is set to use
non-debug runtime libraries. Yes, you may have to compile the library
yourself. If that is not possible, then you will need to place correct
versions of library files to correct places; see next step…

Once all parts are using correct runtime library, you need to make sure
linking really uses the correct versions. Check out compiler directory
options; you might have custom lib and include paths there. Now, make
sure that you have only one version of your libraries in these paths(*),
and those are Release versions. Then the linking goes correct.

(*) You may have both Debug and Release versions
    in the paths, but in that case they absolutely
    must have a different name. This is not the
    case for current SDL libraries, unfortunately :/

When using dynamically loaded (DLL) runtime libraries there is one more
step. You need to make sure that the program loads correct library
versions. One way to do this is to copy correct versions - non-debug - of
libraries to the very same directory where the executable is. If by
accident you leave a debug DLL there, that will cause your program needing
debug runtime libraries, and those are not present on non-VisualC
machines…

Finally, once you have gone through all these steps, your program
should not need the debug runtime libraries, and should work without
VisualC.

(*) As you can see a many things can go wrong, and it is pain to
    switch from debug to non-debug when SDL library is always
    named SDL.DLL & SDL.lib; you need to copy all library files on
    top of old ones.

(!) The Microsoft convention is that debug libraries have appended
    extra D to end of their name. I would suggest this to all SDL
    libraries VisualC projects. Could someone fix this to CVS and
    next releases? Doesn't affect other platforms.

There is a workaround if you do not have compiler, or even sources, and
you have a program which is aasking for the debug version of some system
library. You can simply copy the existing non-debug library and append D
to the name. For example:

  • App cant run, MSVCRTD.DLL is missing.

  • Copy MSVCRT.DLL from windows system folder (or use search)
    to program exe folder and rename to MSVCRT.DLL

  • Run again and do the same for next missing library…

You can use Dependency Walker to see what libraries your program
(or any executable) actually needs. From

http://www.dependencywalker.com

Feel free to add this or edited versions to README.win32 and or
Win32 FAQ or anything.

– Timo Suoranta – @Timo_K_Suoranta