SoftwareNetwork / sw

Software Manager. Build System, Build System Generator and Package Manager. C/C++ and other languages. Tools and libraries for Software Management.
https://software-network.org
Other
115 stars 23 forks source link

Exception when compiling Leptonica #98

Closed AC0792 closed 9 months ago

AC0792 commented 1 year ago

Exception when Compiling leptonica

  1. Cloned leptonica Tagged code (1.82.0)
  2. created build directory and run below command
  3. /c/Qt/Qt5.15.3/Tools/CMake_64/bin/cmake.exe .. -G "Visual Studio 15 2017" -A x64 -DCMAKE_INSTALL_PREFIX=ins it gives below description. -- Setting policy CMP0091 to NEW -- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19042. -- The C compiler identification is MSVC 19.16.27048.0 -- The CXX compiler identification is MSVC 19.16.27048.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: c:/LegacyApp/Microsoft Visual Studio/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: c:/LegacyApp/Microsoft Visual Studio/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring tesseract version 5.2.0... -- Setting build type to 'Release' as none was specified. -- IPO / LTO supported -- Performing Test COMPILER_SUPPORTS_MARCH_NATIVE -- Performing Test COMPILER_SUPPORTS_MARCH_NATIVE - Failed -- CMAKE_SYSTEM_PROCESSOR= -- Found SW: D:/Sindri_Project/UserStories/sw-master-windows-client/sw.exe -- sw: processing dependencies Exception in file D:/dev/cppan2/client2/src/sw/driver/compiler/compiler.cpp:41, function get_msvc_prefix: Cannot find msvc prefix sw command: D:/Sindri_Project/UserStories/sw-master-windows-client/sw.exe -static -platform x64 -compiler msvc-19.16 -d D:/Sindri_Project/UserStories/tesseract/build/.sw/cmake -config d,msr,rwdi,r integrate -cmake-deps D:/Sindri_Project/UserStories/tesseract/build/.sw/cmake/sw.txt -cmake-file-version 6 CMake Error at C:/Users/uie54918/.sw/storage/etc/sw/static/SWConfig.cmake:235 (message): sw: non-zero exit code: 1 Call Stack (most recent call first): CMakeLists.txt:363 (sw_execute)

-- Configuring incomplete, errors occurred! See also "D:/Sindri_Project/UserStories/tesseract/build/CMakeFiles/CMakeOutput.log". See also "D:/Sindri_Project/UserStories/tesseract/build/CMakeFiles/CMakeError.log".

it is throwing exception with message Cannot find msvc prefix

Information: $ sw --version sw.client.sw version 1.0.0 git revision fd8be718fa1eabb8cc8fd429edd9b63d93b0a9cc assembled on 26.07.2022 20:03:06 UTC 27.07.2022 01:33:06 India Standard Time

OS - Windows 10

Compiler : MicroSoft Visual C++ Compiler 14.0

egorpugin commented 1 year ago

Add -DSW_BUILD=1 option to cmake. It will print full sw command. Run that command with --trace option. Post its output.

AC0792 commented 1 year ago

log.txt

Used command : /c/Qt/Qt5.15.3/Tools/CMake_64/bin/cmake.exe .. -G "Visual Studio 15 2017" -A x64 -DCMAKE_INSTALL_PREFIX=inst -DSW_BUILD=1 --trace-redirect=log.txt

egorpugin commented 1 year ago

No, read again. Cmake output will print SW command. Run THAT SW command and append --trace argument to it.

AC0792 commented 1 year ago

sw_command.txt

Command : D:/Sindri_Project/UserStories/sw-master-windows-client/sw.exe -static -platform x64 -compiler msvc-19.16 -d D:/Sindri_Project/UserStories/leptonica/build/.sw/cmake -config d,msr,rwdi,r integrate -cmake-deps D:/Sindri_Project/UserStories/leptonica/build/.sw/cmake/sw.txt -cmake-file-version 6 --trace

Collected in file

egorpugin commented 1 year ago

Now I need you compiler information.

Create main.cpp with #include <iostream>. Run cl /showIncludes main.cpp and post full output.

AC0792 commented 1 year ago

main.cpp Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\iostream Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\istream Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\ostream Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\ios Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xlocnum Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\climits Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\yvals.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\yvals_core.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xkeycheck.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\crtdefs.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\vcruntime.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\sal.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\concurrencysal.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\vadefs.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\crtdbg.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\vcruntime_new_debug.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\vcruntime_new.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\use_ansi.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\limits.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\cmath Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\cstdlib Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdlib.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_malloc.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_search.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stddef.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_wstdlib.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\math.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_math.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xtgmath.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xtr1common Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\cstdio Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\stdio.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_wstdio.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_stdio_config.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\streambuf Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xiosbase Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xlocale Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\cstring Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\string.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_memory.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_memcpy_s.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\errno.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\vcruntime_string.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_wstring.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\stdexcept Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\exception Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\type_traits Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xstddef Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\cstddef Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\initializer_list Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\malloc.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\vcruntime_exception.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\eh.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_terminate.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xstring Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xmemory0 Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\cstdint Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\stdint.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\limits Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\ymath.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\cfloat Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\float.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\cwchar Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\wchar.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_wconio.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_wctype.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_wdirect.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_wio.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_share.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_wprocess.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_wtime.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\sys/stat.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\sys/types.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\new Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xutility Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\utility Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\iosfwd Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xatomic0.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\intrin0.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\typeinfo Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\vcruntime_typeinfo.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xlocinfo Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xlocinfo.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\ctype.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\locale.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\memory Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xmemory Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xfacet c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xlocale(319): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\system_error Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\cerrno Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xcall_once.h Note: including file: c:\LegacyApp\Microsoft Visual Studio\VC\Tools\MSVC\14.16.27023\include\xerrc.h Note: including file: C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\share.h D:\Sindri_Project\UserStories\leptonica\build\main.cpp : fatal error C1083: Cannot open compiler generated file: 'c:\LegacyApp\Microsoft Visual Studio\main.obj': Permission denied

egorpugin commented 1 year ago

In cmake you have

-- The C compiler identification is MSVC 19.16.27048.0
-- The CXX compiler identification is MSVC 19.16.27048.0

but here you have

MSVC\14.16.27023

Is this other compiler? Try to invoke one that is used in cmake.

Also what is your system language?

AC0792 commented 1 year ago

image

Language is English (United States)

MSVC 19.xx , I have not installed , it does not show in C drive as well. Even I confirmed in logs

AC0792 commented 1 year ago

I use Qt Creator and Build Enviroment is setup with MSVC 19. but the compiler we use is C++ 14.16.27023 , to compile and build Application.

egorpugin commented 1 year ago

sw.client.sw-1.0.0.exe.zip

Try this binary. Run this command, post output. sw -static -platform x64 -compiler msvc-19.16 -d D:/Sindri_Project/UserStories/leptonica/build/.sw/cmake -config d,msr,rwdi,r integrate -cmake-deps D:/Sindri_Project/UserStories/leptonica/build/.sw/cmake/sw.txt -cmake-file-version 6 --trace

AC0792 commented 1 year ago

Tried the above binary. here is the output for the above command sw_command1.txt .

egorpugin commented 1 year ago

No, this is your old binary output.

AC0792 commented 1 year ago

I have deleted old build directory, and set SW_EXECUTABLE with above binary image

Used the this sw executable

AC0792 commented 1 year ago

Sw_command2.txt Command : ../../sw.client.sw-1.0.0.exe/sw.client.sw-1.0.0.exe -static -platform x64 -compiler msvc-19.16 -d D:/Sindri_Project/UserStories/leptonica/build/.sw/cmake -config d,msr,rwdi,r integrate -cmake-deps D:/Sindri_Project/UserStories/leptonica/build/.sw/cmake/sw.txt -cmake-file-version 6 --trace

AC0792 commented 1 year ago

Exception in file D:\dev\cppan2\client2\src\sw\driver\compiler\compiler.cpp:41, function get_msvc_prefix: Cannot find msvc prefix for: C:/LegacyApp/Microsoft Visual Studio/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/ml64.exe

is this something related to new preprocessor overview (https://docs.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview?view=msvc-170) how can we avoid that ?

egorpugin commented 1 year ago

Now try this binary. sw.client.sw-1.0.0.exe.zip

AC0792 commented 1 year ago

Exception in file D:\dev\cppan2\client2\src\sw\builder\command.cpp:840, function execute1: When executing: [org.sw.sw.client.driver.cpp.cl_generator-0.4.5]/src/sw/driver/tools/cl_generator.cpp c:\users\uie54918.sw\storage\pkg\09\6e\9b67\src\sdir\src\templates\include\primitives\templates.h(10): fatal error C1083: Cannot open include file: 'ranges': No such file or directory command failed: exit code = 2 Exception in file D:\dev\cppan2\client2\src\sw\builder\command.cpp:840, function execute1: When executing: [pub.egorpugin.primitives.command-0.3.1]/src/uv_command.cpp c:\users\uie54918.sw\storage\pkg\09\6e\9b67\src\sdir\src\templates\include\primitives\templates.h(10): fatal error C1083: Cannot open include file: 'ranges': No such file or directory command failed: exit code = 2 Exception in file D:\dev\cppan2\client2\src\sw\builder\command.cpp:840, function execute1: When executing: [pub.egorpugin.primitives.command-0.3.1]/src/command.cpp c:\users\uie54918.sw\storage\pkg\09\6e\9b67\src\sdir\src\templates\include\primitives\templates.h(10): fatal error C1083: Cannot open include file: 'ranges': No such file or directory command failed: exit code = 2 Total errors: 3 After Running these commands I see these errors

egorpugin commented 1 year ago

Install the latest VS2022.

AC0792 commented 1 year ago

Why these Errors ? What VS2022 will resolve which older versions are not capable of doing this ? My Project basically in Qt , uses C++14.xx compiler if we install new VS2022 does it impact on my project setup ?

egorpugin commented 1 year ago

VS2022 is required for sw itself. Sw uses C++17/20 from VS2019/2022.

AC0792 commented 1 year ago

is it not possible to build Sw for VS 2015 , 2017 and 2019 ?

egorpugin commented 1 year ago

You can build your projects with sw for any VS version. But sw requires VS2019 or VS2022 to be installed for its purposes.

AC0792 commented 1 year ago

I have installed VS2019 , and run CMake for Leptonica it throws error.

cmake .. -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_PREFIX_PATH=%INSTALL_DIR% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DBUILD_PROG=OFF -DSW_BUILD=ON -DBUILD_SHARED_LIBS=ON -- Building for: Visual Studio 16 2019 -- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042. -- The C compiler identification is MSVC 19.27.29120.0 -- The CXX compiler identification is MSVC 19.27.29120.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done

Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:840, function execute1: When executing: [pub.egorpugin.primitives.command-0.3.1]/src/command.cpp C:\Users\uie54918.sw\storage\pkg\09\6e\9b67\src\sdir\src\templates\include\primitives/exceptions.h(17): fatal error C1083: Cannot open include file: 'source_location': No such file or directory command failed: exit code = 2 Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:840, function execute1: When executing: [pub.egorpugin.primitives.command-0.3.1]/src/uv_command.cpp C:\Users\uie54918.sw\storage\pkg\09\6e\9b67\src\sdir\src\templates\include\primitives/exceptions.h(17): fatal error C1083: Cannot open include file: 'source_location': No such file or directory command failed: exit code = 2 Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:840, function execute1: When executing: [org.sw.sw.client.driver.cpp.cl_generator-0.4.5]/src/sw/driver/tools/cl_generator.cpp C:\Users\uie54918.sw\storage\pkg\09\6e\9b67\src\sdir\src\templates\include\primitives/exceptions.h(17): fatal error C1083: Cannot open include file: 'source_location': No such file or directory command failed: exit code = 2 Total errors: 3 sw command: D:/Sindri_Project/UserStories/sw-master-windows-client/sw.exe -shared -platform x64 -compiler msvc-19.27 -d D:/Sindri_Project/softwareIntegrate/leptonica/build-msvc/.sw/cmake -config d,msr,rwdi,r integrate -cmake-deps D:/Sindri_Project/softwareIntegrate/leptonica/build-msvc/.sw/cmake/sw.txt -cmake-file-version 6 CMake Error at C:/Users/uie54918/.sw/storage/etc/sw/static/SWConfig.cmake:235 (message): sw: non-zero exit code: 1 Call Stack (most recent call first): CMakeLists.txt:151 (sw_execute)

-- Configuring incomplete, errors occurred!

egorpugin commented 1 year ago

Yes, because it seems VS2019 is too old. Install the latest VS2022.

AC0792 commented 1 year ago

Installed , and it is working Thanks :)

AC0792 commented 1 year ago

I am actually trying to build leptonica for Android using Windows PC , I have downloaded SW for Linux version and added to Path . .

Using this command : cmake .. -GNinja -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DCMAKE_PREFIX_PATH=%INSTALL_DIR% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DBUILD_PROG=OFF -DSW_BUILD=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_C_COMPILER:STRING=C:/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -DCMAKE_CXX_COMPILER:STRING=C:/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe -DCMAKE_MAKE_PROGRAM:STRING=C:/Qt/Qt5.15.3/Tools/Ninja/ninja.exe -DCMAKE_TOOLCHAIN_FILE=C:/Android/Sdk/ndk/21.3.6528147/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-21

still it shows like

CMake Error at CMakeLists.txt:147 (find_package): By not providing "FindSW.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "SW", but CMake did not find one.

Could not find a package configuration file provided by "SW" with any of the following names:

SWConfig.cmake
sw-config.cmake

Add the installation prefix of "SW" to CMAKE_PREFIX_PATH or set "SW_DIR" to a directory containing one of the above files. If "SW" provides a separate development package or SDK, be sure it has been installed.

Could you please help .

AC0792 commented 1 year ago

it is a bit blocking for my project, could you please look at it? Thanks in advance

egorpugin commented 1 year ago

Run sw setup and re-run cmake.

But you won't be able to build for android using cmake+sw. You need at least sw only. See https://github.com/SoftwareNetwork/sw/issues/100 and https://github.com/SoftwareNetwork/sw/issues/99