You are not logged in.
Hi. When I try to install the anbox-git aur package I get this error message.
What could I try to do?
...
[ 94%] Building CXX object src/CMakeFiles/anbox-core.dir/anbox/wm/window.cpp.o
[ 94%] Building CXX object src/CMakeFiles/anbox-core.dir/anbox/wm/window_state.cpp.o
[ 95%] Building CXX object src/CMakeFiles/anbox-core.dir/anbox/cli.cpp.o
[ 95%] Building CXX object src/CMakeFiles/anbox-core.dir/anbox/daemon.cpp.o
[ 96%] Building CXX object src/CMakeFiles/anbox-core.dir/anbox/logger.cpp.o
/home/riccardo/.cache/yay/anbox-git/src/anbox/src/anbox/logger.cpp:20: error: "BOOST_LOG_DYN_LINK" redefined [-Werror]
20 | #define BOOST_LOG_DYN_LINK
|
<command-line>: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/anbox-core.dir/build.make:1493: src/CMakeFiles/anbox-core.dir/anbox/logger.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1722: src/CMakeFiles/anbox-core.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
Error making: anbox-git (anbox-modules-dkms-git)
Last edited by riccardooo97 (2019-10-07 21:35:43)
Offline
Mod note: moving to AUR Issues
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
if you add --trace to the cmake invocation you find
/usr/lib64/cmake/boost_log-1.71.0/libboost_log-variant-shared.cmake(75): set_target_properties(Boost::log PROPERTIES INTERFACE_COMPILE_DEFINITIONS BOOST_LOG_DYN_LINK )
which causes
/home/riccardo/.cache/yay/anbox-git/src/anbox/src/anbox/logger.cpp:20: error: "BOOST_LOG_DYN_LINK" redefined [-Werror]
20 | #define BOOST_LOG_DYN_LINK
|
<command-line>: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
As anbox/src/anbox/logger.cpp does not check if the symbol is already defined before defining it and all warnings are treated as errors due to CMakeLists.txt containing
if ("${cmake_build_type_lower}" STREQUAL "release" OR "${cmake_build_type_lower}" STREQUAL "relwithdebinfo")
option(Werror "Treat warnings as errors" ON)
else()
option(Werror "Treat warnings as errors" OFF)
endif()
and the PKGBUILD setting -DCMAKE_BUILD_TYPE=Release
Offline
So what exactly should I do?
Offline
diff --git a/src/anbox/logger.cpp b/src/anbox/logger.cpp
index 93b7e10..a5397fe 100644
--- a/src/anbox/logger.cpp
+++ b/src/anbox/logger.cpp
@@ -17,7 +17,9 @@
#include <thread>
+#ifndef BOOST_LOG_DYN_LINK
#define BOOST_LOG_DYN_LINK
+#endif
#include <boost/date_time.hpp>
#include <boost/filesystem.hpp>
#include <boost/log/expressions.hpp>
Apply the above patch to the PKGBUILD and report the issue to the upstream developers.
Offline
Even if I modify that file, when I launch "makepkg -s" again, it come back to the original version and give the same error
Offline
You need to modify the PKGBUILD so the file is patched in `prepare`. If you cannot do that, run makepkg(8) with `--noextract` after you patch the file manually (assuming the sources are still in $srcdir)
Offline