Gemba / skyscraper

Powerful and versatile game data scraper written in Qt and C++.
https://gemba.github.io/skyscraper/
GNU General Public License v3.0
56 stars 14 forks source link

Unable to Build Project #11

Closed retrobit closed 11 months ago

retrobit commented 11 months ago

Was starting work on investigating this issue, but I need some guidance.

OS: Windows 11 (latest via Windows Update as of 12/31/2023) Qt: Desktop Qt 6.6.1 MinGW 64-bit Compiler: MinGW 11.2.0 64-bit for C++

Downloaded and installed Qt via latest online installer and default values. Immediately fails to build within Qt Creator with provided skyscraper.pro file with a "Qt requires a C++17 compiler" error:

g++ -c -fno-keep-inline-dllexport -std=c++11 -O2 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DVERSION=\"3.9.3-dev\" -DQT_NO_DEBUG_OUTPUT -DQT_QML_DEBUG -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_XML_LIB -DQT_CORE_LIB -I../skyscraper -I. -I../skyscraper -IC:/Qt/6.6.1/mingw_64/include -IC:/Qt/6.6.1/mingw_64/include/QtGui -IC:/Qt/6.6.1/mingw_64/include/QtNetwork -IC:/Qt/6.6.1/mingw_64/include/QtXml -IC:/Qt/6.6.1/mingw_64/include/QtCore -Irelease -I/include -IC:/Qt/6.6.1/mingw_64/mkspecs/win32-g++  -o release\imgtools.o ..\skyscraper\src\imgtools.cpp
In file included from C:/Qt/6.6.1/mingw_64/include/QtCore/qtcoreexports.h:7,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qglobal.h:26,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qpair.h:7,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qarraydata.h:8,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qarraydataops.h:8,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qarraydatapointer.h:7,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qlist.h:8,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qstringlist.h:5,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qcommandlineparser.h:7,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/QCommandLineParser:1,
                 from ..\skyscraper\src\cli.h:23,
                 from ..\skyscraper\src\main.cpp:26:
C:/Qt/6.6.1/mingw_64/include/QtCore/qcompilerdetection.h:1239:6: error: #error "Qt requires a C++17 compiler"
 1239 | #    error "Qt requires a C++17 compiler"
      |      ^~~~~

Upon updating skyscraper.pro with CONFIG += release to CONFIG += release c++17, I get new errors, but far fewer, however they are within MinGW itself:

g++ -c -fno-keep-inline-dllexport -std=c++11 -O2 -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DVERSION=\"3.9.3-dev\" -DQT_NO_DEBUG_OUTPUT -DQT_QML_DEBUG -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_XML_LIB -DQT_CORE_LIB -I../skyscraper -I. -I../skyscraper -IC:/Qt/6.6.1/mingw_64/include -IC:/Qt/6.6.1/mingw_64/include/QtGui -IC:/Qt/6.6.1/mingw_64/include/QtNetwork -IC:/Qt/6.6.1/mingw_64/include/QtXml -IC:/Qt/6.6.1/mingw_64/include/QtCore -Irelease -I/include -IC:/Qt/6.6.1/mingw_64/mkspecs/win32-g++  -o release\importscraper.o ..\skyscraper\src\importscraper.cpp
<command-line>: error: expected unqualified-id before string constant
../skyscraper/version:1:1: note: in expansion of macro 'VERSION'
    1 | VERSION="3.9.3-dev"
      | ^~~~~~~
In file included from C:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/bits/move.h:57,
                 from C:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/bits/stl_pair.h:59,
                 from C:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/utility:70,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qcompilerdetection.h:864,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qgenericatomic.h:8,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qatomic_cxx11.h:8,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qbasicatomic.h:8,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qatomic.h:8,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qrefcount.h:7,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/qbytearray.h:8,
                 from C:/Qt/6.6.1/mingw_64/include/QtCore/QByteArray:1,
                 from ..\skyscraper\src\gameentry.h:45,
                 from ..\skyscraper\src\xmlreader.h:29,
                 from ..\skyscraper\src\xmlreader.cpp:25:
C:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/type_traits:200:27: error: 'size_t' has not been declared
  200 |   template <typename _Tp, size_t = sizeof(_Tp)>
      |                           ^~~~~~

Leaving me to suspect this project is built using a different compiler altogether.

I've checked the project documentation and have not found any project build instructions or contribution guidelines. I will gladly document these once I figure them out.

Apologies if this is obvious to anyone else: I haven't touched C++ since school, never Qt, and have only worked on projects small enough where a manually-managed make file was appropriate. Believe I used g++. Since then, my career has largely been in Java and C#, so I'm rusty on some things.

So I guess the best thing to do now is ask the question:

How is the project built? (compiler, C++ version, IDE, etc.)

Gemba commented 11 months ago

Your guess was right. I had never tried it with Qt6 on Windows. Here is some guidance for Qt5 + MinGW 7.3: https://github.com/Gemba/skyscraper/tree/master/win32

I recently ironed out some glitches for building/installing on win, you may try with latest main/HEAD.

retrobit commented 11 months ago

Excellent, I will take a look. Thank you!

retrobit commented 11 months ago

Are there build instructions for other platforms (*nix) as well? I am unable to find them.

Gemba commented 11 months ago

Are there build instructions for other platforms (*nix) as well? I am unable to find them.

Thanks for highlighting, the README does not (yet) cover the development build. For the main/HEAD version on Debian based Linux distros it is like this:

sudo apt install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools p7zip-full
git clone --depth 1 https://github.com/Gemba/skyscraper.git
cd skyscraper
make --ignore-errors clean
rm --force .qmake.stash
QT_SELECT=5 qmake 
make -j$(nproc)
sudo make install

On rebuilding it is mostly the last two or three commands. Three only iff changes in skyscraper.pro have been made.

For MacOS the script mentioned here should give you some hints.

retrobit commented 11 months ago

Ah, I see. Yes, this link also is in the macOS section.

As for Windows 11 Pro 64-bit, I have it building with latest Qt 5.12.12, which is the latest that supports MinGW 7.3.0 64-bit for C++. This is through the latest Qt Creator 12.0.1 (Community) and qmake.

I did have to fix how the handling of PowerShell commands is done, as it wasn't treating white space in the path as part of the path, but rather parsing it as a delimiter for another positional parameter in 'md' ('mkdir'). I will create a PR within the next day or two 😁

retrobit commented 11 months ago

Created PR with all the dirty deets: https://github.com/Gemba/skyscraper/pull/16

Gemba commented 11 months ago

Thanks for fixing it.