"undefined refence to" error

"undefined refence to" error

hello,
I am trying to compile *.f filer using my intel fortran compiler ifot 9.1, it gives me theso many lines in the error message ie. "undefined reference to:"
I have tried the following commands:
ifort -c plot.f
it gives me plot.o file. Toget the executables Ihave also tried
ifort -o plot.o
it gives the same error
Please help me, and suggest me the next step.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

More information is needed about the errors/warnings you received to be of help because the two steps you indicate using do not yield similar diagnostics. The syntax in your second command is not correct. The -o option names the executable. Thus, the second command as written tries naming the executable, hello.o, the same as the intermediate object file produced by first command.

For example:

$ ifort -V -c hello.f90
Intel Fortran Compiler for 32-bit applications, Version 9.1 Build 20071016Z Package ID: l_fc_c_9.1.052
Copyright (C) 1985-2007 Intel Corporation. All rights reserved.

Intel Fortran 9.1-6694

$ ifort -o hello.o
ifort: Command line error: no files specified; for help type "ifort -help"

A corrected form of the second command is:

$ ifort -o hello hello.o

$ ./hello
Hello world

Leave a Comment

Please sign in to add a comment. Not a member? Join today