ScanTailor-Advanced / scantailor-advanced

ScanTailor Advanced is the version that merges the features of the ScanTailor Featured and ScanTailor Enhanced versions, brings new ones and fixes.
GNU General Public License v3.0
189 stars 7 forks source link

Unable to build ScanTailor-Advanced on Windows #83

Closed ableeker closed 4 months ago

ableeker commented 9 months ago

Building ScanTailor-Advanced on Windows has been quite hard. The building instructions first explain how to build the dependencies, it took a few tries, but in the end I've been able to build these with MinGW64. Then the instructions tell you how to build ST, however I've had no luck with that so far. When I generate the cmake files, I get the following a number of times:

  Target "math_tests" links to target "Boost::unit_test_framework" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?

This ends with the following:

CMake Generate step failed.  Build files cannot be regenerated correctly.

However, cmake files have been generated, so when I consider this a warning, and try to build ST, I get the following:

E:\Source\ScanTailor\scantailor-advanced\src\math\LinearSolver.h:9:10: fatal error: boost/scoped_array.hpp: No such file or directory
 #include <boost/scoped_array.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
mingw32-make[2]: *** [src\math\CMakeFiles\math.dir\build.make:96: src/math/CMakeFiles/math.dir/LinearSolver.cpp.obj] Error 1
mingw32-make[2]: *** Waiting for unfinished jobs....
In file included from E:\Source\ScanTailor\scantailor-advanced\src\math\LinearFunction.h:9:0,
                 from E:\Source\ScanTailor\scantailor-advanced\src\math\LinearFunction.cpp:4:
E:/Source/ScanTailor/scantailor-advanced/src/foundation/VecT.h:7:10: fatal error: boost/scoped_array.hpp: No such file or directory
 #include <boost/scoped_array.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
mingw32-make[2]: *** [src\math\CMakeFiles\math.dir\build.make:180: src/math/CMakeFiles/math.dir/LinearFunction.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:649: src/math/CMakeFiles/math.dir/all] Error 2
mingw32-make: *** [Makefile:181: all] Error 2

Am I missing something?

zvezdochiot commented 6 months ago

@ableeker say:

Am I missing something?

You have not installed the boost required for compilation.

ableeker commented 6 months ago

I have compiled Boost, and the other dependencies. That wasn't easy either. It's available in Libs, but when I tried to compile SA, I still got these errors.

zvezdochiot commented 6 months ago

@ableeker say:

It's available in Libs

Boost is not available for STA builds. This is clearly indicated to you in the build error message.

ableeker commented 6 months ago

I've been able to compile STA eventually. I haven't changed anything, but I've decided to delete everything, and start all over again. I haven't done anything different, but this time, Libs did compile, and this time were complete, and as a result STA did compile successfully at last.

ableeker commented 5 months ago

I've tried to build all 4 versions (Qt 5 and 6, MinGW, and MSVC), and I can at this moment build 3 out of 4. The Qt 5 versions with MinGW, and MSVC will build and run. The Qt 6 MinGW version builds without error (building with source libs, and with the Perl libs as well), but when running scantailor.exe will start, and then fail without error. I haven't found out how to fix this. Building the Qt 6 MSVC version with jpeg-turbo on the other hand, will fail with error: scantailor-advanced\src\core\Utils.h(97): error C2027: use of undefined type 'QObject' I've been able to fix this, but I had to modify the source. Add a new line 8 to scantailor-advanced\src\core\Utils.h: #include <QObject> When this is done, it will install, but running scantailor.exe will pop up an error complaining that jpeg62.dll is missing. As this has been built successfully, you can just copy it the install location. Running scantailor.exe will now start STA. To fix this I had to modify CMakeLists.txt: Change line 99 real_path_find_glob(jpeg_dir_assumed "${DEPENDENCIES_ROOT}/jpeg-[0-9]*") to real_path_find_glob(jpeg_dir_assumed "${DEPENDENCIES_ROOT}/libjpeg-turbo-[0-9]*.[0-9]*.[0-9]*") And change line 135 add_dynamic_library_locations(JPEG::JPEG "libjpeg-62.dll") to add_dynamic_library_locations(JPEG::JPEG "jpeg62.dll") After this STA will build and install successfully, including the missing jpeg62.dll, and running scantailor.exe will start STA.

ableeker commented 4 months ago

Closed, because the proposed fix has been implemented by PR #94.