Problem with libPostscriptdll when building in Windows

I need to build root on windows to include some math functionality not available in the standard windows binaries and the home-built version seems to have a problem with the libPostscript.dll not present in the standard binaries. This is a problem building on both Windows 7 and Windows 10.

I have built root as follows:

Start with downloaded sources from root.cern/content/release-53436

Use Visual studio express 2013 (compiler ID’s as C/C++ “Optimizing Compiler Version 18.00.31101 for x86”. (The visual studio version number convention is very confusing)

Fetch and install third party packages:
- Zlib
- GSL 1.16
- FFTW

Use cmake to configure with the command line:

cmake -G “Visual Studio 12” -Dbuiltin_zlib=ON -DZLIB_INCLUDE_DIR=“C:\Program Files (x86)\GnuWin32\include” -DZLIB_LIBRARY_DEBUG=“C:\Program Files (x86)\GnuWin32\lib\zlib.lib” -DZLIB_LIBRARY_RELEASE=“C:\Program Files (x86)\GnuWin32\lib\zlib.lib” -Dbuiltin_gsl=OFF -DGSL_CBLAS_LIBRARY=“C:\Program Files\gsl\x86\lib\cblas.lib” -DGSL_INCLUDE_DIR=“C:\Program Files\gsl\x86\include” -DGSL_LIBRARY=“C:\Program Files\gsl\x86\lib\gsl.lib” -Dfftw3=ON -Dbuiltinfftw3=OFF -DFFTW_DIR=“C:\Program Files (x86)\fftw” -DFFTW_INCLUDE_DIR=“C:\Program Files (x86)\fftw” -DFFTW_LIBRARY=“C:\Program Files (x86)\fftw\libfftw3-3.lib” -Dminuit2=ON -Dpython=ON -Droofit=ON …/root-src

No errors

Then
cmake --build .

No errors

Then try run root, create a TCanvas
root [0] new TCanvas
(class TCanvas*)0x3495a78

Canvas creates OK
Now use the drawing toolbar to make a picture, and try to save to a pdf

root [1] C:\Users\hseywerd\root-build\bin\libPostscript.dll: The specified module could not be found.
Load Error: Failed to load Dynamic link library C:\Users\hseywerd\root-build\bin\libPostscript.dll
Error in TCint::AutoLoad: failure loading library libPostscript.dll for class TPDF
Error in TPluginHandler::SetupCallEnv: class TPDF not found in plugin Postscript
[/b]

Then root terminates unpleasantly

Works fine for gif, bmp etc., but fails for all the types in the TPostscipt library (ps, pdf, eps, etc…)

I look back in the build files but see no errors, and the libPostscript dll exists.

There is a workaround: If I copy the libPostscript dll from the prebuilt windows version, no error.
Nonetheless, it would be nice to know what’s going on.

Thanks

Hi,

Why are you specifying -Dbuiltin_zlib=ON and then -DZLIB_INCLUDE_DIR="C:\Program Files (x86)\GnuWin32\include" -DZLIB_LIBRARY_DEBUG="C:\Program Files (x86)\GnuWin32\lib\zlib.lib" -DZLIB_LIBRARY_RELEASE="C:\Program Files (x86)\GnuWin32\lib\zlib.lib"
Please try with “-Dbuiltin_zlib=ON” only.

Cheers, Bertrand.