Compiling older code with gcc/g++

  • Thread starter Pollywoggy
  • Start date
  • #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
mgb_phys
Science Advisor
Homework Helper
7,819
13
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
403
1
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
53
0
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.
 

Related Threads on Compiling older code with gcc/g++

  • Last Post
Replies
6
Views
2K
Replies
3
Views
3K
Replies
5
Views
2K
  • Last Post
Replies
0
Views
3K
  • Last Post
Replies
5
Views
3K
  • Last Post
Replies
13
Views
6K
  • Last Post
Replies
0
Views
1K
  • Last Post
Replies
0
Views
2K
Top