Re: Q: Linking in ESQL/C and Fortran
Posted in 1998
Troy Peterson wrote: > > Question: > > I developed some esql/c subroutines and called them successfully > from a standard 'c' program. > > However, when we attempt to compile a standard Fortran program which > emulates the 'c' program, we can't seem to get the esql/c include > files to link. Include files? Or C code object files to be linked into a Fortran executable? Or are you rewriting the ESQL/C code in (the no longer available, AFAIK) ESQL/Fortran product? > All of the standard esql/c api calls, like 'sqli_prep', show up as > unlocatable even though we have the "INCLUDE" environment variable > pointing to the right directory and have even put the include path > on the Fortran compiler command line. INCLUDE does not normally have an effect on C or ESQL/C, so I assume it affects your Fortran compiler. > Any ideas on what we're doing wrong? No definitive ideas because you've not given us enough information. I'd suspect that you are mislinking your Fortran program, not adding the ESQL/C libraries to the link line. On the other hand, you might be using a fussy mode (for a Fortran 77 compiler -- the latest sort I've used) where variables and functions have to be pre-declared before use. The Fortran compiler won't recognize ESQL/C code directly, of course, so you have to write the ESQL/C functions so that they meet the Fortran calling conventions. What those are depend on your Fortran compiler -- the information I have is probably woefully out of date. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>