Hi,
On 2014/09/02 05:23 PM, Donald G Porter wrote:
> If I assume the Tcl installation is one from ActiveTcl, would it be> sufficient to copy the zlib1.dll found beside ...\path\to\tclsh86.exe> over to also be beside ...\path\to\myExecutable.exe ?
It should be.
It is also safer (in principle) to use the .dll from ActiveTcl
installation that from zlib.net, as the ActiveTcl one should be build
against the same C runtime as the Tcl DLLs (more on that below).
Note that these DLLs may be build against MSVCRT.DLL (the zlib.net
zlib1.dll is), which means that if you are deploying to older versions
of Windows (pre-XP) you may also need to distribute MSVCRT.DLL (via the
installer provided by Microsoft).
> Do all Tcl builds from source likewise place a zlib1.dll alongside> the tclsh.exe or wish.exe they install? Are those also good for> copying where they are needed for escort services of embedding programs?
Well, maybe. All your DLLs are dynamically linked against a C runtime
library. That could be LIBCMT, or MSVCRT, or MCVCR70/80/90/100
depending on your compiler. Each runtime library has its own heap. If
you allocate memory in one C runtime (on its heap), and try to
deallocate it in another, you will crash your program. This can also
happen if you statically link to the C runtime!
Some developers are familiar with this problem and design their software
accordingly (providing an appropriate Xfree() function for every
Xalloc() so that heap association is maintained), but a lot of
*nix-based software is not written in this fashion because it is seldom
an issue on Linux or Free/OpenBSD. There are (or have been) Tcl
extension DLLs that are written the bad way.
Ideally you want your wish.exe, tcl86.dll and zlib1.dll to all be linked
against the same C runtime.
Regards,
Trevor
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Tcl-Core mailing list
Tcl-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcl-core