Re: make problem
"Colin S. Miller" <[email protected]>
| Newsgroups | gmane.comp.gnu.utils |
|---|---|
| Organization | SunSITE.dk - Supporting Open source |
| Message-ID | <[email protected]> |
[email protected] wrote: > Hi all, > > > libNLM.a(output.o): In function `output_': > output.f90:(.text+0x2e4): undefined reference to `nf_close_' > output.f90:(.text+0x381): undefined reference to `nf_close_' > output.f90:(.text+0x47d): undefined reference to `nf_close_' > libUTIL.a(close_io.o): In function `close_io_': > close_io.f90:(.text+0x42): undefined reference to `nf_close_' > close_io.f90:(.text+0x6d): undefined reference to `nf_close_' > libUTIL.a(close_io.o):close_io.f90:(.text+0x98): more undefined > references to `nf_close_' follow > libUTIL.a(close_io.o): In function `close_io_': > > So what gives? Is it not finding something? Then why does it not say > "file not found"? What does the -L part mean? Haven't been able to > figure that out. > Greg, -L/path/to/lib adds the path to the search directories for libraries (collections of object files). > libNLM.a(output.o): In function `output_': > output.f90:(.text+0x2e4): undefined reference to `nf_close_' > output.f90:(.text+0x381): undefined reference to `nf_close_' > output.f90:(.text+0x47d): undefined reference to `nf_close_' means that the function output_[0], in the object file "output.o" (probably from output.f) in libNLM.a, referenced the function nf_close_, but this function could not be found. In Unix, an object (or library) that defines a function, must be listed after the object (or library) that calls that function. [0] Or 'output', most computer languages change the name of the functions in the object files. E.g., in C, all functions are preceded with a '_'. It appears that fortran appends a '_'. HTH, Colin S. Miller > Greg > -- Replace the obvious in my email address with the first three letters of the hostname to reply.