【问题标题】:Leptonica on Windows + Visual StudioWindows + Visual Studio 上的 Leptonica
【发布时间】:2020-04-01 10:33:00
【问题描述】:

我已按照以下步骤在 Windows 上使用 Visual Studio 安装 Leptonica

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.

除了第 5 步,我什么都做了。

我的构建目录现在如下所示:

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

我似乎找不到 leptonica.sin 以及如何与 Visual Studio 集成?我需要剩下的步骤。我是 Visual Studio 的新手,请注意我的问题。

我有 Visual Studio 2019

【问题讨论】:

    标签: windows visual-studio installation leptonica


    【解决方案1】:

    您可能已经弄清楚了(我希望如此),但如果没有……您列出的第 5 步有一个错字:

    1. 在您的 Visual Studio 版本中构建解决方案 (leptonica.sin)。

    它应该是 leptonica.sLn,就像在 Visual Studio 解决方案文件中一样。

    在您的构建目录列表中,您有 leptonic.sln。如果您双击它应该在 Visual Studio 中打开(假设默认/正确安装)。

    【讨论】:

      【解决方案2】:

      至少使用 Visual Studio 2019,您实际上不必像这样使用 CMake 手动生成解决方案文件,因为 Visual Studio 现在支持打开包含 CMakeLists.txt 文件的文件夹,就好像它们是解决方案一样。

      您只需执行以下操作即可在 Windows 上构建 Leptonica:

      1. https://software-network.org/client/下载sw-master-windows-client.zip。
      2. 将 sw.exe 解压缩到某个目录 sw_dir
      3. sw_dir 添加到您的路径环境变量。注销并登录以确保路径已更新。
      4. 进入 power shell 等并从命令行运行“sw setup”。
      5. Git 将 Leptonica 克隆到 https://github.com/danbloomberg/leptonica 的某个目录
      6. 启动 Visual Studio。
      7. 从 VS 显示的初始对话框中选择“打开本地文件夹”。选择 Leptonica 文件夹。

      此时,Visual Studio 将开始在该文件夹上运行 CMake,假设它可以找到 sw.exe,它应该会成功。这一步需要一段时间。完成后,您可以从build 顶级菜单中build all

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-05-07
        • 2013-12-22
        • 1970-01-01
        • 1970-01-01
        • 2010-12-19
        • 2014-08-16
        • 1970-01-01
        相关资源
        最近更新 更多