0

I'm really struggling right now trying to build 1.74 version of leptonica as a Visual Studio project. I have followed the official leptonica instructions from here http://www.leptonica.com/source/README.html

But I get following errors while running cmake

Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR) 
Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)

And after that the result solution which I run in Visual Studio doesn't build because of these errors:

visual studio errors

I would really appreciate if someone told me how to fix that problem or if there any other way to create build-able Visual Studio project for leptonica version >=1.74

Thank you

P.S. I have VS2015 if that matters

Community
  • 1
  • 1
Olja Muravjova
  • 117
  • 1
  • 7
  • 2
    So you need to install missed libraries (GIF, JPEG and so on). They are listed in README you refer to under "I/O libraries leptonica is dependent on" section. – Tsyvarev Feb 13 '18 at 11:53
  • you can build using one liner command line using vcpkg. – seccpur Feb 13 '18 at 16:33

1 Answers1

1

You can download vcpkg from github and run vcpkg.exe in the Powershell prompt( opened in administrative mode) . vcpkg can install many open source projects (both static and dynamic libraries are supported) as packages ready for use in VS 2017 and VS 2015 (SP3) IDE. You can use choose x86 or x64 platform and in some cases even allows selection of toolset ( eg .\vcpkg install boost:x64-windows-v141 ). If you use 'integrate install' as the vcpkg command line, all the libraries will be automatically linked with your project and the project .dll files will be automatically copied to your application folder.

So, in your case, after the the installation of vcpkg.exe, you type .\vcpkg install leptonica:x64-windows and after installation type .\vcpkg integrate install. The leptonica library will be linked automatically to your project .

seccpur
  • 4,996
  • 2
  • 13
  • 21