#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Code written in SunOS but doesn't compile in GCC


    I have a project that I need to compile that was written in a SunOS environment about 20 years ago. I need to resurrect the program (I need the data that the program processes for research).

    I am currently running Cygwin on my Windows computer with the GCC compiler.

    The program compiled correctly on the SunOS environment years ago, but I get all sorts of errors that I think are compatibility issues.

    I have the entire directory of libraries, header files, etc.

    Does anyone have any suggestions on how to get the code to compile without having to rewrite the program?

    Btw, I am new to C programming, so keep that in mind.

    Thanks!
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,179
    Rep Power
    2222
    Sorry, but Saruman borrowed my Seeing Stone and has never returned it. Since I cannot telepathically link with you in order to see what you are seeing and to know what you know, we must resort to somewhat more primitive forms of communication.

    Why don't you post the errors that you are getting? Use copy-and-paste instead of giving us a synopsis -- the actual wording of error and warning messages contains a wealth of information.

    Also, don't leave out warnings. Warnings are much more important than error messages.

    Since error and warning messages also contain line numbers, it should help if you were to post the parts of the program where those error/warnings occur. Give precedence to the first ones, since the subsequent errors/warnings could be caused by an earlier error/warning rather than by the code being flagged.

    Be sure to use code tags when you post code.
  4. #3
  5. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,114
    Rep Power
    1803
    Without seeing the error log how do you expect anyone to to comment? That diagnostic information is exactly what is needed to make a err... diagnosis. :rolleyes:

    Even a sample of the common errors would help.

    If the code is written in pre-ANSI/ISO K&R C, then I believe GCC dropped support for that several versions ago. If you have functions defined like:

    Code:
    int function( arg1, arg2 )
        int arg1 ;
        int arg2 ;
    {
        return 0 ;
    }
    rather than:

    Code:
    int function( int arg1, int arg2 )
    {
        return 0 ;
    }
    then a modern compiler may not compile it without modification. However even in 1993 K&R style would have been increasingly rare - C was standardised by ANSI in 1989 and adopted by ISO in 1990.

    You might try compiling with the GCC -traditional compiler option, but it does not have any effect in modern versions of GCC. You might get away with it by installing version 2.95.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0
    ..

    Comments on this post

    • clifford disagrees : Rude. Closing threads is bad form. I had something useful to add - now you'll never know.

IMN logo majestic logo threadwatch logo seochat tools logo