Compiling older code with gcc/g++

  • Thread starter Thread starter Pollywoggy
  • Start date Start date
  • Tags Tags
    Code
Click For Summary
Older C++ code written for gcc 2.95 faces compatibility issues with newer g++ versions, such as 3.3 and 4.x. The original poster seeks a way to compile this outdated code without modifying it, as it is proprietary and cannot be altered without permission. Suggestions include the possibility of the code using non-standard features like "varargs" instead of the standard "stdarg." The most straightforward solution proposed is to install the original gcc 2.95 compiler to successfully compile the legacy code.
Pollywoggy
Messages
53
Reaction score
0
I have some older cpp code that was written when gcc 2.95 was in general use, but this code does not compile under g++ 4.x or even 3.3.

Is there a way to tell the compiler to compile code that is old and not written to present standards? I seem to recall there is a way to do it but I do not recall specifics. Even if I had the programming skill to do it, the code says that it is forbidden to modify the code without permission from the company that developed it. They provided the code but do not allow it to be modified (it is for a game).

thanks
 
Technology news on Phys.org
If it was written to c++ standards at the time it should still work. Presumably it included some g++ non-standard additions that have been dropped - can you post specific examples?
 
Pollywoggy said:
I have some older cpp code that was written when gcc 2.95 was in general use, but this code does not compile under g++ 4.x or even 3.3.

Is there a way to tell the compiler to compile code that is old and not written to present standards?
...

Not really.
Maybe it uses "varargs" instead "stdarg" (the standard). The best thing to do is to install gcc 2.95 , etc...
 
Rogerio said:
Not really.
Maybe it uses "varargs" instead "stdarg" (the standard). The best thing to do is to install gcc 2.95 , etc...

Thanks, I think that might be the easiest thing to do. I could not post the problem code here because it is proprietary.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

Replies
6
Views
3K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 27 ·
Replies
27
Views
6K
  • · Replies 30 ·
2
Replies
30
Views
6K
  • · Replies 16 ·
Replies
16
Views
9K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 9 ·
Replies
9
Views
9K
  • · Replies 2 ·
Replies
2
Views
2K