Commit d6b5e4efe3f45d95c53a33d15266863eaca17325

Authored by Jay Berkenbilt
1 parent 35cf9eba

static runtime


git-svn-id: svn+q:///qpdf/trunk@790 71b93d88-0707-0410-a8cf-f5a4172ac649
Showing 1 changed file with 18 additions and 9 deletions
README.windows
... ... @@ -35,10 +35,8 @@ directory. You can find the path to it by running
35 35 type -P libgcc_s_dw2-1.dll
36 36  
37 37 replacing libgcc_s_dw2-1.dll with whatever gcc DLL is shown, if
38   -different. For an unknown reason, building with -static-libgcc
39   -results in executables that fail their test suites. I'm guessing this
40   -has to do with static data being duplicated between the DLL and the
41   -executable, but I don't really know.
  38 +different. Redistribution of this DLL is unavoidable as of this
  39 +writing; see "Static Runtime" below for details.
42 40  
43 41 From your cygwin prompt, add the absolute path to the libqpdf/build
44 42 directory to your PATH. Make sure you can run the qpdf command by
... ... @@ -93,8 +91,19 @@ within visual C++, and then click Retry in qpdf.
93 91  
94 92 A release version of qpdf is built by default. You will probably have
95 93 to edit msvc.mk to change /MD to /MDd to build a debugging version.
96   -It has also been attempted to build qpdf with /MT, but it does not
97   -pass its test suite in this configuration. I have not investigated.
98   -Perhaps this is the same issue as with -static-libgcc with mingw. In
99   -both cases, statically linking the runtime results in non-working
100   -executables/DLL.
  94 +Note that you must redistribute the Microsoft runtime DLLs. Linking
  95 +with static runtime won't work; see "Static Runtime" below for
  96 +details.
  97 +
  98 +Static Runtime
  99 +==============
  100 +
  101 +Building the DLL and executables with static runtime does not work
  102 +with either Visual C++ .NET 2008 (a.k.a. vc9) using /MT or with mingw
  103 +(at least as of 4.4.0) using -static-libgcc. The reason is that, in
  104 +both cases, there is static data involved with exception handling, and
  105 +when the runtime is linked in statically, exceptions cannot be thrown
  106 +across the DLL to EXE boundary. Since qpdf uses exception handling
  107 +extensively for error handling, we have no choice but to redistribute
  108 +the C++ runtime DLLs. Maybe this will be addressed in a future
  109 +version of the compilers.
... ...