eteran / nedit-ng

a Qt5 port of the NEdit using modern C++14
GNU General Public License v2.0
96 stars 26 forks source link

Compilation with gcc-11 problem #309

Closed sambo57u closed 3 years ago

sambo57u commented 3 years ago

Hi, I just moved from Fedora 33 to 34, which uses gcc-11. When I try to build nedit-ng it quickly gives an error below:

.... Scanning dependencies of target Regex [ 1%] Building CXX object Regex/CMakeFiles/Regex.dir/Execute.cpp.o /root/rpmbuild/BUILD/nedit-ng-2020.2/Regex/Execute.cpp: In function 'uint32_t {anonymous}::greedy(uint8_t, uint32_t)': /root/rpmbuild/BUILD/nedit-ng-2020.2/Regex/Execute.cpp:137:62: error: 'numeric_limits' is not a member of 'std' 137 | const uint32_t max_cmp = (max > 0) ? max : std::numeric_limits::max(); | ^~~~~~ /root/rpmbuild/BUILD/nedit-ng-2020.2/Regex/Execute.cpp:137:85: error: expected primary-expression before '>' token 137 | const uint32_t max_cmp = (max > 0) ? max : std::numeric_limits::max(); | ^ /root/rpmbuild/BUILD/nedit-ng-2020.2/Regex/Execute.cpp:137:88: error: '::max' has not been declared; did you mean 'std::max'? 137 | const uint32_t max_cmp = (max > 0) ? max : std::numeric_limits::max(); | ^~~ | std::max In file included from /usr/include/c++/11/algorithm:62, from /usr/include/qt5/QtCore/qglobal.h:142, from /usr/include/qt5/QtCore/QtGlobal:1, from /root/rpmbuild/BUILD/nedit-ng-2020.2/Util/include/Util/Compiler.h:5, from /root/rpmbuild/BUILD/nedit-ng-2020.2/Util/include/Util/Raise.h:5, from /root/rpmbuild/BUILD/nedit-ng-2020.2/Util/include/Util/string_view.h:5, from /root/rpmbuild/BUILD/nedit-ng-2020.2/Regex/Execute.h:6, from /root/rpmbuild/BUILD/nedit-ng-2020.2/Regex/Execute.cpp:2: /usr/include/c++/11/bits/stl_algo.h:3467:5: note: 'std::max' declared here 3467 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /root/rpmbuild/BUILD/nedit-ng-2020.2/Regex/Execute.cpp: In function 'bool {anonymous}::match(uint8_t, size_t*)': /root/rpmbuild/BUILD/nedit-ng-2020.2/Regex/Execute.cpp:580:53: error: 'numeric_limits' is not a member of 'std' 580 | uint32_t min = std::numeric_limits::max(); | ^~~~~~ /root/rpmbuild/BUILD/nedit-ng-2020.2/Regex/Execute.cpp:580:76: error: expected primary-expression before '>' token 580 | uint32_t min = std::numeric_limits::max(); | ^ /root/rpmbuild/BUILD/nedit-ng-2020.2/Regex/Execute.cpp:580:79: error: '::max' has not been declared; did you mean 'std::max'? 580 | uint32_t min = std::numeric_limits::max(); | ^~~ | std::max In f .....

eteran commented 3 years ago

Interesting. Are you building a release or the latest in master? If you are building the release, please try to see if it is fixed in master.

If you are building master, then I expect this to be a pretty easy fix. Looks like the header <limits> was not included in Execute.cpp when it should be.

sambo57u commented 3 years ago

I am building the master. Also in Compile.cpp. After inserting those headers it build fine. Thanks!

eteran commented 3 years ago

Fixed in master, thanks!