Syntax_ErrorX00
Syntax_ErrorX00

Reputation: 213

Linking a static library in gfortran using preprocessor

I have a library file created in gfortran, how to link it to a host program that uses its procedures using preprocessor (without using the GUI method) For exemple in Intel Visual fortran this is done by:

!DEC$ Objcomment lib: 'library.lib' 

Upvotes: 2

Views: 915

Answers (1)

s.ouchene
s.ouchene

Reputation: 1869

As mentioned here, there is no such directive in GCC that allow you linking static libraries. Instead, use the command line:

gfortran filename.f90 -o filename -L[path] -l[lib]

Upvotes: 1

Related Questions