Wyrmgus icon indicating copy to clipboard operation
Wyrmgus copied to clipboard

Compilation error

Open B4rabbas opened this issue 3 years ago • 25 comments

Hello,

I'm struggling with the building, maybe I've missed something

Here is which command I've used CMakeOutput.log

`sudo apt install -y debhelper devscripts cmake make nsis upx gnupg

git clone https://github.com/Andrettin/Wyrmgus.git

cd Wyrmgus

mkdir build

git submodule update --init --remote --force

cmake . && make`

And there is the result `spiegel@spiegel-laptop:~/Wyrmgus$ cmake . && make CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package): Could not find a package configuration file provided by "Qt5Multimedia" with any of the following names:

Qt5MultimediaConfig.cmake
qt5multimedia-config.cmake

Add the installation prefix of "Qt5Multimedia" to CMAKE_PREFIX_PATH or set "Qt5Multimedia_DIR" to a directory containing one of the above files. If "Qt5Multimedia" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:1223 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/spiegel/Wyrmgus/CMakeFiles/CMakeOutput.log".`

I've also added CMakeOutput.log

B4rabbas avatar Mar 04 '21 04:03 B4rabbas

I've find my old own how-to compile, The same error occuring how compile.txt

B4rabbas avatar Mar 04 '21 04:03 B4rabbas

There are some new dependencies now, namely:

libboost-dev qtbase5-dev qtlocation5-dev qtmultimedia5-dev qtpositioning5-dev

I've updated the Ubuntu build instructions to include them: https://github.com/Andrettin/Wyrmgus/blob/master/doc/building_on_ubuntu_20.txt

Andrettin avatar Mar 04 '21 06:03 Andrettin

I'll try this tonight with the new instructions on Pop!_OS

DinkyDyeAussie avatar Mar 04 '21 06:03 DinkyDyeAussie

Tried it on Pop!_OS 20.10 and got a "missing SDL_mixer" error when I ran 'cmake ..'

DinkyDyeAussie avatar Mar 04 '21 08:03 DinkyDyeAussie

`spiegel@spiegel-laptop:~/wyrmsun/Wyrmgus/build$ cmake .. -- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU 9.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.69.0")
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find Lua51 (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) cmake/modules/FindLua51.cmake:94 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:1228 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/spiegel/wyrmsun/Wyrmgus/build/CMakeFiles/CMakeOutput.log". spiegel@spiegel-laptop:~/wyrmsun/Wyrmgus/build$ `

B4rabbas avatar Mar 04 '21 14:03 B4rabbas

CMakeOutput.log

B4rabbas avatar Mar 04 '21 14:03 B4rabbas

here is my updated instructions (for the dependencies) how.compile.txt

B4rabbas avatar Mar 04 '21 14:03 B4rabbas

here is the lua package I've found on the ubuntu 20.04 official repo lua5.3:i386 5.3.3-1.1ubuntu2 lua5.2:i386 5.2.4-1.1build3 lua5.1:i386 5.1.5-8.1build4 lua50 5.0.3-8build1 lua5.3 5.3.3-1.1ubuntu2 lua5.2 5.2.4-1.1build3 lua5.1 5.1.5-8.1build4

B4rabbas avatar Mar 04 '21 16:03 B4rabbas

I've installed lua5.1:i386 and lua5.1, it change nothing I've the exact same error. Maybe this build require some argument to "init": or some additionnal command? EDIT : I've just installed libluabind-dev too and retry for same result

I've look on stackoverflow some people say it could be required to add export LUA_INCLUDE_DIR=/bin/lua5.1 in cmakelist.txt. Unfortunatly, I'm not used to this and I dunno where to insert this into it

B4rabbas avatar Mar 04 '21 16:03 B4rabbas

@DinkyDyeAussie Ops, sorry, I forgot to include the following library in the list: libsdl-mixer1.2-dev

Andrettin avatar Mar 04 '21 17:03 Andrettin

@B4rabbas You need the "-dev" liblua library, i.e.: liblua5.1-0-dev

And additionally, tolua++: libtolua++5.1-dev

Andrettin avatar Mar 04 '21 17:03 Andrettin

So I gave it a go compiling in pop os, and it got to 87% then spat out this error

fatal error: Qtlocation/private/qgeo_json_p.h - no such file or directory.

I followed all the directions.

DinkyDyeAussie avatar Mar 04 '21 19:03 DinkyDyeAussie

tolua++ lib is libtolua++5.1-dev in 20.04 official repo https://packages.ubuntu.com/source/focal/tolua++ (just for clarification)

B4rabbas avatar Mar 04 '21 20:03 B4rabbas

Ok now I have many CMake Error at CMakeLists.txt:1623 (add_library): Target "wyrmgus" links to target "Qt5::LocationPrivate" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

They're pointing to line 1623, 1624 and 1626

Here is all dep I've Installed (I've checked, I think everything is here) sudo apt install -y build-essential ccache git libboost-dev libboost-filesystem-dev libboost-iostreams-dev libboost-regex-dev libboost-locale-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libglew-dev libpng-dev libcairo2-dev libfreetype6-dev libvorbis-dev qtbase5-dev qtlocation5-dev qtmultimedia5-dev qtpositioning5-dev lua5.1 libsdl-mixer1.2-dev libsdl1.2-dev zlib1g-dev libtolua++5.1-dev liblua5.1-0-dev

See the joined txt or the cmake output for a more detailed building process. CMakeOutput.log Terminbal output.txt

And thanks for the support, truly. At first I was thinking this will be such a message in a bottle.

B4rabbas avatar Mar 04 '21 20:03 B4rabbas

So I gave it a go compiling in pop os, and it got to 87% then spat out this error

fatal error: Qtlocation/private/qgeo_json_p.h - no such file or directory.

I followed all the directions.

That is an important point, which I forgot to mention. GeoJSON parsing requires Qt private headers, which aren't present in the Ubuntu packaging of QtLocation. That is only necessary when wanting to develop new maps based on geodata though, for compiling the game for normal gameplay it is not needed. There is a CMake option for Wyrmgus to deactivate the GeoJSON parsing requirement, you just need to call cmake with the "-DWITH_GEOJSON=OFF" command line option.

I've updated the documentation accordingly.

Andrettin avatar Mar 04 '21 20:03 Andrettin

Ok now I have many CMake Error at CMakeLists.txt:1623 (add_library): Target "wyrmgus" links to target "Qt5::LocationPrivate" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

They're pointing to line 1623, 1624 and 1626

Here is all dep I've Installed (I've checked, I think everything is here) sudo apt install -y build-essential ccache git libboost-dev libboost-filesystem-dev libboost-iostreams-dev libboost-regex-dev libboost-locale-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libglew-dev libpng-dev libcairo2-dev libfreetype6-dev libvorbis-dev qtbase5-dev qtlocation5-dev qtmultimedia5-dev qtpositioning5-dev lua5.1 libsdl-mixer1.2-dev libsdl1.2-dev zlib1g-dev libtolua++5.1-dev liblua5.1-0-dev

See the joined txt or the cmake output for a complete building process output. CMakeOutput.log Terminbal output.txt

And thanks for the support, truly. At first I was thinking this will be such a message in a bottle.

I'm glad to help :) This problem can probably has the same origin as the one @DinkyDyeAussie mentioned, so the same solution (calling CMake with the "-DWITH_GEOJSON=OFF" command line option) should work.

Andrettin avatar Mar 04 '21 20:03 Andrettin

DWITH_GEOJSON=OFF works, but riiiight at the end of compilation, it throws me this error:

error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const wchar_t*) [with _Traits = std::char_traits]’

127 | ostr << ( t ? t : L"null string" ); ^

Arrow points to the bracket at the end of the function. No idea why it's doing this.

DinkyDyeAussie avatar Mar 05 '21 05:03 DinkyDyeAussie

DWITH_GEOJSON=OFF works, but riiiight at the end of compilation, it throws me this error:

error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const wchar_t*) [with _Traits = std::char_traits]’

127 | ostr << ( t ? t : L"null string" ); ^

Arrow points to the bracket at the end of the function. No idea why it's doing this.

That's a subtle error which occurs only in Ubuntu 20.10 (AFAIK). The reason is that Boost was doing something invalid, and which is now an error in C++20. In older versions of GCC that limitation hadn't been implemented yet, and in newer versions of Boost that is fixed (from 1.73 IIRC). So it only occurs in a specific combination which is present in 20.10 specifically. Upgrading Boost, or downgrading GCC should fix the issue.

But note that the problematic Boost code is used just for the automated tests, so I could add a CMake option to allow compiling without the automated test suite, and then things should work fine too.

Andrettin avatar Mar 05 '21 06:03 Andrettin

Yeah add that option to disable boost

DinkyDyeAussie avatar Mar 05 '21 10:03 DinkyDyeAussie

I have an error during the compilation, it say there is no rule to build target for « tolua.cpp » [ 94%] Building CXX object CMakeFiles/wyrmgus.dir/src/xbrz/xbrz.cpp.o make[2]: *** Aucune règle pour fabriquer la cible « tolua.cpp », nécessaire pour « CMakeFiles/wyrmgus.dir/tolua.cpp.o ». Arrêt. make[1]: *** [CMakeFiles/Makefile2:139 : CMakeFiles/wyrmgus.dir/all] Erreur 2 make: *** [Makefile:163 : all] Erreur 2 Here is the complete output log output.txt

B4rabbas avatar Mar 05 '21 17:03 B4rabbas

and the output for cmake confuguration

output.txt

B4rabbas avatar Mar 05 '21 17:03 B4rabbas

@DinkyDyeAussie I've added the option to enable/disable compiling the test project now (it is enabled by default): https://github.com/Andrettin/Wyrmgus/commit/66df4b19549bb0e46e87c041f4540b1cdca39e85

Andrettin avatar Mar 06 '21 09:03 Andrettin

@B4rabbas if I recall correctly, someone had a similar issue in the past, and they solved it by cleaning their Wyrmgus CMake output files, and then trying again

Andrettin avatar Mar 06 '21 09:03 Andrettin

@B4rabbas if I recall correctly, someone had a similar issue in the past, and they solved it by cleaning their Wyrmgus CMake output files, and then trying again

Can you be more precise : I don't understand wich file I've to remove/modify.

B4rabbas avatar Mar 07 '21 12:03 B4rabbas

I think he just deleted all of the CMake output. I would just use "git status" on the wyrmgus directory to see which files are build output (i.e. ones that were not part of the repository a priori), remove all of them, and then try building again.

Andrettin avatar Mar 08 '21 06:03 Andrettin