Hi,

Problem and Background

I'm trying to compile a program that uses some legacy c code generated using the f2c translator (version of May 1991 13:06:06).
decide.c is the source that contains the translated fortran to c code and f2c.c is the header file.
Durring compilation I get the following errors:

Compilation Errors

1>decide.obj : error LNK2019: unresolved external symbol _e_rsfe referenced in function _inputs_
1>decide.obj : error LNK2019: unresolved external symbol _do_fio referenced in function _inputs_
1>decide.obj : error LNK2019: unresolved external symbol _s_rsfe referenced in function _inputs_
1>decide.obj : error LNK2019: unresolved external symbol _e_wsfe referenced in function _inputs_
1>decide.obj : error LNK2019: unresolved external symbol _s_wsfe referenced in function _inputs_
1>decide.obj : error LNK2019: unresolved external symbol _create_ referenced in function _decide_
1>decide.obj : error LNK2019: unresolved external symbol _f_rew referenced in function _proc45_

On-closer inspection the source code comments indicate that these are "built-in functions" which i assume to mean they are intrinsic to the fortran compiler? Examining the previously used makefile to compile the code it indicates the following:

makefile:

    composite: maincomp.c screenio.c cscreens.c turbine.c stat.c decide.c file.c\
               sys.c dummy.c util.c cglobal.h composite.h cscreens.h f2c.h\
               maincomp.h screenio.h turbine.h util.h makefile
        gcc maincomp.c screenio.c cscreens.c turbine.c stat.c decide.c util.c\
                file.c dummy.c sys.c -I/usr/5include -L/home/boltoj/f2c/libF77\
                -lF77 -L/home/boltoj/f2c/libI77 -lI77 -L/usr/5lib -lcurses -lm\
                -o composite -g

This indicates that the fortran77 libaries (F77 and I77) were originally used to compile the program. However in the source file decide.c and header file f2c.h there is no preprocessor directives to the listed fortran libaries in the header files.

I am a bit stumped on to how to get this code compiling and to why exactly it is not compliling. My theory is that those libaries are needed for those 'built-in' functions and that those libaries do not exist on my system. Could someone please confirm that I am correct? What makes me think I am wrong is that there is no reference to those libaries specified anywhere but the make file.

Thanks for any insight.

Rob

My theory is that those libaries are needed for those 'built-in' functions and that those libaries do not exist on my system.

Yup. Your only two options are to find libraries that implement the functions being called, or simulate the functionality by writing definitions for those functions manually.

Thanks for the quick reply and suggestion for a solution.

Are you not in possession of the original fortran code to regenerate the code with current version?

These are linker, not compiler errors. Do you have the libf2c package installed on your system? Also, why use f2c instead of gfortran?

This question has already been answered. Start a new discussion instead.