Sun Studio 12: Fortran Programming Guide

11.1.9 Libraries and Linking With the f95 Command

To link the proper Fortran and C libraries, use the f95 command to invoke the linker.

Example 1: Use the compiler to do the linking:


demo% cc -c someCroutine.c
demo% f95 theF95routine.f someCroutine.o  <- The linking step
demo% a.out
 4.0 4.5
 8.0 9.0
demo%