INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

One paricular program won't add into library archive

One paricular program won't add into library archive

One paricular program won't add into library archive

(OP)
I have a Fortran library archive (libmy.a) that contains various subroutines.
I then try to add another one with:

ifort -c -O3 ~/mydir/sub.f
ar -rv ~/mydir/libmy.a sub.o

However, while libmy's attributes change, its size does not, so it seems as if sub is not being incorporated (and trying to use the library gives an error message "undefined reference to `sub_'".
The other subroutines in the library were added exactly like this, without any problems.
What reasons could there be for this particular subroutine not being incorporated?

RE: One paricular program won't add into library archive

No idea why rv does not work but you could do it in two steps

CODE

ar -dv ~/mydir/libmy.a sub.o
ar -qv ~/mydir/libmy.a sub.o 

RE: One paricular program won't add into library archive

(OP)
Thanks, but didn't make any difference.
There was a previous version of "reader.f", saved under the completely different name "a.f", in the same directory as "reader.f". Eventually I found that deleting this file lead to the "undefined reference to `reader_'" error. Renaming it to anything not ending in .f lead to this error as well.
I simply copied the contents of "reader.f" into "a.f", deleted the original "reader.f" and renamed "a.f" to "reader.f", after which everything worked.
So I found the solution, although I still do not know what the problem is. How the file "a.f" could have any influence when it is not referred to anywhere, remains a puzzle.

RE: One paricular program won't add into library archive

The name of the file does not matter : only the names of the subroutines, functions, modules... inside are important

Fran├žois Jacq

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close