Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Re: Linking iss...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 8167 of 8775
Post > Topic >>

Re: Linking issue

by nospam@[EMAIL PROTECTED] (Richard Maine) Apr 23, 2008 at 07:18 AM

jlar <jesper.webmail@[EMAIL PROTECTED]
> wrote:

> I am trying to link my application to the ngmath library....

> > pgf90 -L. -lngmath -o test test.o

Looks to me like the usual ordering problem with the command line. The
command line is *VERY* sensitive to ordering. Try reordering it as

  pgf90 test.o -L. -lngmath -o test

The way you have it, the *First* thing that happens is that the linker
looks to see what is needed in ngmath. Nothing is needed yet, so then
the linker adds in test.o. After test.o is aded, stuff from nglib will
be needed, but the linker doesn't go back and check again.

This "feature" is common to most linkers today; it isn't just a Fortran
matter. I find it pretty crude compared to some linkers I've worked with
in the past. It is also a FAQ.

P.S. I recommend that you *NOT* use the name test for your test file.
That particular (and common) choice happens to result in a lot of
confusions because there is already a system command named test. Unless
you are sophisticated enough to know that and how to deal with it, you
are likely to end up getting the system command when trying to run your
program. The resulting confusion generates another FAQ. Use just about
any other name. Heck, use test1 if you want - just anything except test.

-- 
Richard Maine                    | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle           |  -- Mark Twain
 




 3 Posts in Topic:
Linking issue
jlar <jesper.webmail@[  2008-04-23 06:49:17 
Re: Linking issue
nospam@[EMAIL PROTECTED]   2008-04-23 07:18:56 
Re: Linking issue
jlar <jesper.webmail@[  2008-04-23 20:45:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 8:44:51 CDT 2008.