Hi, I am stuck on a compilation problem. I know this exact error has occurred in newer environments and I thought it was related to gcc 11, but my Devuan Ceres (Debian Sid, or unstable) environment is now throwing this error. The
Arch Linux guys have had this exact problem for four months.
g++-10 -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 -Wnon-virtual-dtor -Wno-unused-function -Wshadow -Wno-maybe-uninitialized -O3 -DNDEBUG `wx-config --cxxflags --debug=no` -pthread `pkg-config --cflags openssl` `pkg-config --cflags libcurl` `pkg-config --cflags libssh2` `pkg-config --cflags gtk+-3.0` -isystem/usr/include/gtk-3.0 `pkg-config --cflags libselinux` -DHAVE_SELINUX -c base/icon_loader.cpp -o /tmp/FreeFileSync_Make/ffs/src/base/icon_loader.cpp.o
In file included from /usr/include/wx-3.0/wx/memory.h:15,
from /usr/include/wx-3.0/wx/object.h:19,
from /usr/include/wx-3.0/wx/image.h:16,
from base/icon_loader.h:12,
from base/icon_loader.cpp:7:
/usr/include/wx-3.0/wx/string.h: In member function 'bool wxString::iterator::operator==(const wxString::const_iterator&) const':
/usr/include/wx-3.0/wx/string.h:4062:16: warning: in C++20 this comparison calls the current function recursively with reversed arguments
4062 | { return i == *this; }
| ~~^~~~~~~~
base/icon_loader.cpp: In function 'zen::FileIconHolder fff::getFileIcon(const Zstring&, int)':
base/icon_loader.cpp:219:26: error: expected primary-expression before '(' token
219 | return FileIconHolder(static_cast<GIcon*>(::g_object_ref(gicon)) /*pass ownership*/, maxSize);
| ^
compilation terminated due to -Wfatal-errors.
make: *** [Makefile:124: /tmp/FreeFileSync_Make/ffs/src/base/icon_loader.cpp.o] Error 1
make: Leaving directory '/usr/src/freefilesync/11.14-1/FreeFileSync/Source'
My system has these gcc versions installed:
ii gcc 4:10.2.1-1 amd64 GNU C compiler
ii gcc-10 10.3.0-8 amd64 GNU C compiler
ii gcc-10-base:amd64 10.3.0-8 amd64 GCC, the GNU Compiler Collection (base package)
ii gcc-11-base:amd64 11.2.0-3 amd64 GCC, the GNU Compiler Collection (base package)
I have explicitly set
CXX=G++-10. Can anybody help me identify why this code fails to compile when it compiled fine in the past?