Issue with compiling on CentOS 7

Get help for specific problems
Posts: 309
Joined: 7 Jan 2018

bgstack15

Distro: CentOS 7
Using gcc-8 from devtoolset-8 from "sclo-rh" repository.
Since FreeFileSync 10.17, my compilation fails. I am unable to find any useful information on the Internet about the exact failure.
make: Entering directory '/usr/src/freefilesync/10.18-build/FreeFileSync/Source'
mkdir -p /tmp/FreeFileSync_Make/ffs/src/ui/
g++ -std=c++2a -pipe -DWXINTL_NO_GETTEXT_MACRO -I../.. -I../../zenXml -include "zen/i18n.h" -include "zen/warn_static.h" -Wall -Wfatal-errors -Wmissing-include-dirs -Wswitch-enum -Wcast-align -Wshadow -Wnon-virtual-dtor -O3 -DNDEBUG -fPIC `wx-config --version=3.0 --cxxflags --debug=no` -pthread `pkg-config --cflags openssl` `pkg-config --cflags libcurl` `pkg-config --cflags libssh2` `pkg-config --cflags gtk+-2.0` -isystem/usr/include/gtk-2.0 `pkg-config --cflags libselinux` -DHAVE_SELINUX -c ui/small_dlgs.cpp -o /tmp/FreeFileSync_Make/ffs/src/ui/small_dlgs.cpp.o
In file included from ui/small_dlgs.cpp:8:
/opt/rh/devtoolset-8/root/usr/include/c++/8/variant: In instantiation of ‘std::__detail::__variant::_Move_ctor_base<<anonymous>, _Types>::_Move_ctor_base(std::__detail::__variant::_Move_ctor_base<<anonymous>, _Types>&&) [with bool <anonymous> = false; _Types = {zen::Zbase<char, zen::DefaultStoragePolicy>, zen::FileError}]’:
/opt/rh/devtoolset-8/root/usr/include/c++/8/variant:575:7:   required from ‘_Res std::future<_Res>::get() [with _Res = std::variant<zen::Zbase<char, zen::DefaultStoragePolicy>, zen::FileError>]’
../../wx+/async_task.h:56:61:   required from ‘void zen::impl::ConcreteTask<ResultType, Fun>::evalResult(std::false_type) [with ResultType = std::variant<zen::Zbase<char, zen::DefaultStoragePolicy>, zen::FileError>; Fun = {anonymous}::CloudSetupDlg::OnGdriveUserAdd(wxCommandEvent&)::<lambda(const std::variant<zen::Zbase<char, zen::DefaultStoragePolicy>, zen::FileError>&)>; std::false_type = std::integral_constant<bool, false>]’
../../wx+/async_task.h:52:9:   required from ‘void zen::impl::ConcreteTask<ResultType, Fun>::evaluateResult() [with ResultType = std::variant<zen::Zbase<char, zen::DefaultStoragePolicy>, zen::FileError>; Fun = {anonymous}::CloudSetupDlg::OnGdriveUserAdd(wxCommandEvent&)::<lambda(const std::variant<zen::Zbase<char, zen::DefaultStoragePolicy>, zen::FileError>&)>]’
../../wx+/async_task.h:50:10:   required from here
/opt/rh/devtoolset-8/root/usr/include/c++/8/variant:499:7: error: no matching function for call to ‘std::__detail::__variant::_Copy_ctor_base<false, zen::Zbase<char, zen::DefaultStoragePolicy>, zen::FileError>::_Copy_ctor_base()’
       {
       ^
compilation terminated due to -Wfatal-errors.
make: *** [Makefile:117: /tmp/FreeFileSync_Make/ffs/src/ui/small_dlgs.cpp.o] Error 1
make: Leaving directory '/usr/src/freefilesync/10.18-build/FreeFileSync/Source'
I as of yet know nothing about the OOP parts of C++ so I don't know how to contribute on this problem yet. I suspect it has to do with gcc-8; I don't know of a sustainable way to get gcc 9 on CentOS 7 yet.

Can anyone provide any guidance on how to compile the program on CentOS 7?
Posts: 309
Joined: 7 Jan 2018

bgstack15

I ended up reverting to devtoolset-7 and -std=c++17, and commenting out the "#include <charconv>" and then it can all compile...
Posts: 21
Joined: 5 Oct 2018

jmsxl

Thanks for documenting the workaround.