Compiling older code with gcc/g++

  • Thread starter Pollywoggy
  • Start date
  • Tags
    Code
  • #1
53
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
 

Answers and Replies

  • #2
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?
 
  • #3
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...
 
  • #4
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.
 

Suggested for: Compiling older code with gcc/g++

2
Replies
60
Views
655
Replies
22
Views
1K
Replies
12
Views
758
Replies
34
Views
1K
Replies
3
Views
507
Replies
3
Views
517
Replies
2
Views
491
Replies
5
Views
554
Replies
11
Views
551
Back
Top