summaryrefslogtreecommitdiff
path: root/win32/DLL_FAQ.txt
diff options
context:
space:
mode:
Diffstat (limited to 'win32/DLL_FAQ.txt')
-rw-r--r--win32/DLL_FAQ.txt97
1 files changed, 62 insertions, 35 deletions
diff --git a/win32/DLL_FAQ.txt b/win32/DLL_FAQ.txt
index 1746a95..fb18e07 100644
--- a/win32/DLL_FAQ.txt
+++ b/win32/DLL_FAQ.txt
@@ -175,7 +175,7 @@ in the zlib distribution, or at the following location:
175 zlib in other programming languages. Some of them, like Ada 175 zlib in other programming languages. Some of them, like Ada
176 (GNAT) and Fortran (GNU G77), have C bindings implemented 176 (GNAT) and Fortran (GNU G77), have C bindings implemented
177 initially on Unix, and relying on the C calling convention. 177 initially on Unix, and relying on the C calling convention.
178 On the other hand, the pre- .Net versions of Microsoft Visual 178 On the other hand, the pre- .NET versions of Microsoft Visual
179 Basic require STDCALL, while Borland Delphi prefers, although 179 Basic require STDCALL, while Borland Delphi prefers, although
180 it does not require, FASTCALL. 180 it does not require, FASTCALL.
181 181
@@ -203,10 +203,10 @@ in the zlib distribution, or at the following location:
203 zlib distribution. 203 zlib distribution.
204 204
205 205
206 8. I need to use zlib in my Microsoft .Net project. What can I 206 8. I need to use zlib in my Microsoft .NET project. What can I
207 do? 207 do?
208 208
209 - Henrik Ravn has contributed a .Net wrapper around zlib. Look 209 - Henrik Ravn has contributed a .NET wrapper around zlib. Look
210 into contrib/dotzlib/, inside the zlib distribution. 210 into contrib/dotzlib/, inside the zlib distribution.
211 211
212 212
@@ -225,8 +225,8 @@ in the zlib distribution, or at the following location:
225 depend on it should also be linked to MSVCRT.DLL. 225 depend on it should also be linked to MSVCRT.DLL.
226 226
227 227
22810. Why are you saying that ZLIB1.DLL and my application must be 22810. Why are you saying that ZLIB1.DLL and my application should
229 linked to the same C run-time (CRT) library? I linked my 229 be linked to the same C run-time (CRT) library? I linked my
230 application and my DLLs to different C libraries (e.g. my 230 application and my DLLs to different C libraries (e.g. my
231 application to a static library, and my DLLs to MSVCRT.DLL), 231 application to a static library, and my DLLs to MSVCRT.DLL),
232 and everything works fine. 232 and everything works fine.
@@ -277,12 +277,6 @@ in the zlib distribution, or at the following location:
277 even run on it. Furthermore, no serious user should run 277 even run on it. Furthermore, no serious user should run
278 Windows 95 without a proper update installed. 278 Windows 95 without a proper update installed.
279 279
280 There is also the fact that the mainstream C compilers for
281 Windows are Microsoft Visual C++ 6.0, and gcc/MinGW. Both
282 are producing executables that link to MSVCRT.DLL by default,
283 without offering other dynamic CRTs as alternatives easy to
284 select by users.
285
286 280
28712. Why are you not linking ZLIB1.DLL to 28112. Why are you not linking ZLIB1.DLL to
288 <<my favorite C run-time library>> ? 282 <<my favorite C run-time library>> ?
@@ -295,27 +289,60 @@ in the zlib distribution, or at the following location:
295 to a static C library, you may as well consider linking zlib 289 to a static C library, you may as well consider linking zlib
296 in statically, too. 290 in statically, too.
297 291
298 * Linking ZLIB1.DLL to CRTDLL.DLL looks very appealing, 292 * Linking ZLIB1.DLL to CRTDLL.DLL looks appealing, because
299 because CRTDLL.DLL is present on every Win32 installation. 293 CRTDLL.DLL is present on every Win32 installation.
300 Unfortunately, it has a series of problems: it raises 294 Unfortunately, it has a series of problems: it does not
301 difficulties when using it with C++ code, it does not work 295 work properly with Microsoft's C++ libraries, it does not
302 with 64-bit file offsets, (and so on...), and Microsoft 296 provide support for 64-bit file offsets, (and so on...),
303 discontinued its support a long time ago. 297 and Microsoft discontinued its support a long time ago.
304 298
305 * Linking ZLIB1.DLL to MSVCR70.DLL, supplied with the 299 * Linking ZLIB1.DLL to MSVCR70.DLL or MSVCR71.DLL, supplied
306 Microsoft .NET platform and Visual C++ 7.0 or newer, is not 300 with the Microsoft .NET platform, and Visual C++ 7.0/7.1,
307 a good option. Although it is available for free download 301 raises problems related to the status of ZLIB1.DLL as a
308 and distribution, its presence is scarce on today's Win32 302 system component. According to the Microsoft Knowledge Base
309 installations. If it will ever become more popular than 303 article KB326922 "INFO: Redistribution of the Shared C
310 MSVCRT.DLL and will be pre-installed on the future Win32 304 Runtime Component in Visual C++ .NET", MSVCR70.DLL and
311 systems, we will probably think again about it. 305 MSVCR71.DLL are not supposed to function as system DLLs,
312 306 because they may clash with MSVCRT.DLL. Instead, the
313 * Linking ZLIB1.DLL to NTDLL.DLL is not possible. 307 application's installer is supposed to put these DLLs
314 NTDLL.DLL exports only a part of the C library, and only on 308 (if needed) in the application's private directory.
315 Windows NT systems. 309 If ZLIB1.DLL depends on a non-system runtime, it cannot
316 310 function as a redistributable system component.
317 311
31813. I need to link my own DLL build to a CRT different than 312 * Linking ZLIB1.DLL to non-Microsoft runtimes, such as
313 Borland's, or Cygwin's, raises problems related to the
314 reliable presence of these runtimes on Win32 systems.
315 It's easier to let the DLL build of zlib up to the people
316 who distribute these runtimes, and who may proceed as
317 explained in the answer to Question 14.
318
319
32013. If ZLIB1.DLL cannot be linked to MSVCR70.DLL or MSVCR71.DLL,
321 how can I build/use ZLIB1.DLL in Microsoft Visual C++ 7.0
322 (Visual Studio .NET) or newer?
323
324 - Due to the problems explained in the Microsoft Knowledge Base
325 article KB326922 (see the previous answer), the C runtime that
326 comes with the VC7 environment is no longer considered a
327 system component. That is, it should not be assumed that this
328 runtime exists, or may be installed in a system directory.
329 Since ZLIB1.DLL is supposed to be a system component, it may
330 not depend on a non-system component.
331
332 In order to link ZLIB1.DLL and your application to MSVCRT.DLL
333 in VC7, you need the library of Visual C++ 6.0 or older. If
334 you don't have this library at hand, it's probably best not to
335 use ZLIB1.DLL.
336
337 We are hoping that, in the future, Microsoft will provide a
338 way to build applications linked to a proper system runtime,
339 from the Visual C++ environment. Until then, you have a
340 couple of alternatives, such as linking zlib in statically.
341 If your application requires dynamic linking, you may proceed
342 as explained in the answer to Question 14.
343
344
34514. I need to link my own DLL build to a CRT different than
319 MSVCRT.DLL. What can I do? 346 MSVCRT.DLL. What can I do?
320 347
321 - Feel free to rebuild the DLL from the zlib sources, and link 348 - Feel free to rebuild the DLL from the zlib sources, and link
@@ -331,7 +358,7 @@ in the zlib distribution, or at the following location:
331 CYGWIN1.DLL, and it is distributed under the name CYGZ.DLL. 358 CYGWIN1.DLL, and it is distributed under the name CYGZ.DLL.
332 359
333 360
33414. May I include additional pieces of code that I find useful, 36115. May I include additional pieces of code that I find useful,
335 link them in ZLIB1.DLL, and export them? 362 link them in ZLIB1.DLL, and export them?
336 363
337 - No. A legitimate build of ZLIB1.DLL must not include code 364 - No. A legitimate build of ZLIB1.DLL must not include code
@@ -344,7 +371,7 @@ in the zlib distribution, or at the following location:
344 is a redistributable file, named VCLxx.DLL. 371 is a redistributable file, named VCLxx.DLL.
345 372
346 373
34715. May I remove some functionality out of ZLIB1.DLL, by enabling 37416. May I remove some functionality out of ZLIB1.DLL, by enabling
348 macros like NO_GZCOMPRESS or NO_GZIP at compile time? 375 macros like NO_GZCOMPRESS or NO_GZIP at compile time?
349 376
350 - No. A legitimate build of ZLIB1.DLL must provide the complete 377 - No. A legitimate build of ZLIB1.DLL must provide the complete
@@ -353,7 +380,7 @@ in the zlib distribution, or at the following location:
353 different file name, as suggested in the previous answer. 380 different file name, as suggested in the previous answer.
354 381
355 382
35616. I made my own ZLIB1.DLL build. Can I test it for compliance? 38317. I made my own ZLIB1.DLL build. Can I test it for compliance?
357 384
358 - We prefer that you download the official DLL from the zlib 385 - We prefer that you download the official DLL from the zlib
359 web site. If you need something peculiar from this DLL, you 386 web site. If you need something peculiar from this DLL, you