1

I have followed the following steps for installing Leptonica on Windows with Visual Studio

3. Building on Windows

   (a) Building with Visual Studio

       1. Download the latest SW
              (Software Network https://software-network.org/)
          client from https://software-network.org/client/
       2. Unpack it, add to PATH.
       3. Run once to perform cmake integration:
          sw setup
       4. Run:
          git clone [https://github.com/danbloomberg/leptonica](https://github.com/danbloomberg/leptonica)
          cd leptonica
          mkdir build
          cd build
          cmake ..
       5. Build a solution (leptonica.sin) in your Visual Studio version.

I did everything except for step 5.

My build directory now looks as follows:

ALL_BUILD.vcxproj          LeptonicaConfig.cmake
ALL_BUILD.vcxproj.filters  LeptonicaConfig-version.cmake
cmake_install.cmake        LeptonicaTargets.cmake
cmake_uninstall.cmake      src/
CMakeCache.txt             sw_build_dependencies.vcxproj
CMakeFiles/                sw_build_dependencies.vcxproj.filters
config_auto.h.in           uninstall.vcxproj
INSTALL.vcxproj            uninstall.vcxproj.filters
INSTALL.vcxproj.filters    x64/
lept.pc                    ZERO_CHECK.vcxproj
leptonica.sln              ZERO_CHECK.vcxproj.filters

I cannot seem to find leptonica.sin and how to integrate with visual studio ? I need the steps that are left. I am new to visual studio please mind my question.

I have Visual Studio 2019

Perl Del Rey
  • 959
  • 1
  • 11
  • 25

2 Answers2

0

You probably already figured this out (I'd hope) but if not... Step #5 as you listed has a typo:

  1. Build a solution (leptonica.sin) in your Visual Studio version.

It's supposed to be leptonica.sLn, as in a Visual Studio Solution file.

In your build directory listing you have leptonic.sln. If you double-click that it should open in Visual Studio (assuming a default/correct install).

DCreeron
  • 86
  • 2
0

With Visual Studio 2019 at least you don't actually have to generate a solution file with CMake manually like this as Visual Studio now supports opening folders that contain CMakeLists.txt files as though they are solutions.

You can just do the following to build Leptonica on Windows:

  1. Download sw-master-windows-client.zip from https://software-network.org/client/.
  2. Unzip sw.exe to some directory sw_dir.
  3. Add sw_dir to your path environment variable. Log out and log in to make sure the path is updated.
  4. Enter power shell etc. and run "sw setup" from a command line.
  5. Git clone Leptonica to some directory from https://github.com/danbloomberg/leptonica
  6. Start up Visual Studio.
  7. Choose "Open local folder" from the intitial dialog VS presents you with. Select the Leptonica folder.

At this point Visual Studio will begin running CMake on the folder and it should succeed assuming it can find sw.exe. This step takes a while. After it completes you can build all from the build toplevel menu.

jwezorek
  • 8,592
  • 1
  • 29
  • 46