Building suddenly fails on Ubuntu 20.04 with gcc 8.4.0. I suspect I recently updated gcc or otherwise changed something in my configuration that caused the error (described below).
Steps to reproduce:
$ git clone https://github.com/openigtlink/OpenIGTLink
$ mkdir igt-build
$ cd igt-build
$ cmake -G 'Unix Makefiles' ../OpenIGTLink
$ make -j
Here are the full build logs: cmake.logmake.log This is the relevant part:
/home/allem/tmp/OpenIGTLink/Source/igtlSocket.cxx: In member function ‘int igtl::Socket::Send(const void*, igtlUint64)’:
/home/allem/tmp/OpenIGTLink/Source/igtlSocket.cxx:339:75: error: ‘numeric_limits’ is not a member of ‘std’
int n = send(this->m_SocketDescriptor, buffer + total, (length > std::numeric_limits<int>::max()) ? std::numeric_limits<int>::max() : length-total, flags);
/home/allem/tmp/OpenIGTLink/Source/igtlSocket.cxx: In member function ‘igtlUint64 igtl::Socket::Receive(void*, igtlUint64, bool&, int)’:
/home/allem/tmp/OpenIGTLink/Source/igtlSocket.cxx:368:75: error: ‘numeric_limits’ is not a member of ‘std’
int n = recv(this->m_SocketDescriptor, buffer + total, (length > std::numeric_limits<int>::max() ? std::numeric_limits<int>::max() : length - total), 0);
Some C++ Standard Library headers have been changed to no longer include other headers that they do need to depend on. As such, C++ programs that used standard library components without including the right headers will no longer compile.
The following headers are used less widely in libstdc++ and may need to be included explicitly when compiled with GCC 11:
Building suddenly fails on Ubuntu 20.04 with gcc 8.4.0. I suspect I recently updated gcc or otherwise changed something in my configuration that caused the error (described below).
Steps to reproduce:
Here are the full build logs: cmake.log make.log This is the relevant part:
It seems the same as the issue described in gitlab.com/wg1/jpeg-xl#84:
Adding an explicit
#include <limits>
toigtlSocket.cxx
solves the issue. I'll create a PR shortly.