I have "been tasked" with trying to build old software (VERY old software, in fact, not compiled since 2014) on our newer platform, specifically using g++ 9.4.0 in Ubuntu 20.04. While doing so, I have encountered a number of errors, all of them occurring inside some of include files from "/usr/include/c++/9". The offending files are type_traits.h, bits/allocator.h, bits/basic_string.h, and bits/alloc_traits.h.
The build output looks like this:
make -C /home/schudall/TDWR_Appl_LocalUB/csci04/csc25
make[1]: Entering directory '/home/schudall/TDWR_Appl_LocalUB/csci04/csc25'
/usr/bin/g++ -c -I/home/schudall/TDWR_Appl_LocalUB/csci04/csc20 -I/home/schudall/TDWR_Appl_LocalUB/csci04/csc25 -Dvolatile= -O2 -Di586 -Wall -Wno-unused -DWX_MULTITHREADED -D_REENTRANT WxBase.C -o LINUX/WxBase.o
In file included from /usr/include/c++/9/bits/move.h:55,
from /usr/include/c++/9/bits/nested_exception.h:40,
from /usr/include/c++/9/exception:144,
from /usr/include/c++/9/ios:39,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from WxBase.C:33:
/usr/include/c++/9/type_traits:506:12: error: redefinition of ‘struct std::is_function<_Res(_ArgTypes ...)>’
506 | struct is_function<_Res(_ArgTypes...) volatile _GLIBCXX_NOEXCEPT_QUAL>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/type_traits:458:12: note: previous definition of ‘struct std::is_function<_Res(_ArgTypes ...)>’
458 | struct is_function<_Res(_ArgTypes...) _GLIBCXX_NOEXCEPT_QUAL>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is just one example of a number of other, similar errors being called out.
Point of disclosure: While I have some years' experience in programming C++, most of my experience has been in taking older code and transferring it to our systems. My C++ training dates to about 20-25 years ago (pre ANSI???). Also, I am newer to the Ubuntu environment.
With all that said, it looks like maybe I am not including something that these files need, or not passing in proper arguments to the compiler, or perhaps I have not installed all needed libraries to build on this device. OR the code is so deprecated, but I would not know where to begin cleaning things up with these errors. Reading the man pages has not helped :(
What I would like to ask is, if anyone with a deeper (and more up-to-date) base of experience than me can point me in the right direction, and give me some idea as to what I need to do to solve these issues? Thank you in advance!