Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Compiling older code with gcc/g++

  1. Feb 23, 2009 #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? 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).

  2. jcsd
  3. Feb 23, 2009 #2


    User Avatar
    Science Advisor
    Homework Helper

    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?
  4. Feb 25, 2009 #3
    Not really.
    Maybe it uses "varargs" instead "stdarg" (the standard). The best thing to do is to install gcc 2.95 , etc...
  5. Feb 25, 2009 #4
    Thanks, I think that might be the easiest thing to do. I could not post the problem code here because it is proprietary.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook