I’m working with an old embedded system, and I would like to get the files compiling on my Linux desktop with a modern C++ compiler (e.g. g++12) for some testing. I’ve done this before with similar codes, and it turned out to be pretty handy.
In the case the problem is that the embedded system used gcc 2.7, which predates C++ standardization in 1998. As part of this, they have gcc’s 2.7’s header files mixed in with the embedded system header files. (e.g. iostream and iostream.h)
Of course, these old headers can’t be built by a modern compiler. So, I’d like them to be ignored. So, for example, if “#include ” I would like to get g++12’s version, not the version from the embedded system (gcc2.7) But when I use -I, g++ will search the -I files first.
For example: “g++ -c -I file.c” will search first, and therefore find that version of iostream. Which doesn’t work.
How can I get g++12 to prefer it’s own iostream to the one?