Re: Linking issue



jlar <jesper.webmail@xxxxxxxxx> 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
.



Relevant Pages

  • Re: Excluding a lib from linking
    ... Concerning choice and inclusion of .lib files, it seems that the linker ... - the command line; ... Like you, i have tried the pragma directive with /nodefaultlib, without any ... I have a kind of solution, but it is necessary to remove the lib file in the ...
    (microsoft.public.vc.language)
  • Re: VS 2008 linker: how to see the paths that the linker is following to libc*.lib?
    ... Use the /VERBOSE linker option to see exactly what was linked from where. ... the linker output to a file. ... Visual Studio, the environment variables are ignored and the ... IDE or always from the command line, then this is not the problem.. ...
    (microsoft.public.vc.language)
  • Re: Why cant it find odbc32.lib? Its there.
    ... set additional directories for compiler and linker for ... specific project in project settings. ... I made sure the Lib and Include directories in the Platform SDK were ... Now the command line build is complaining about not finding ...
    (microsoft.public.vc.language)
  • Re: Linker error
    ... I thought I can use 32-bit linker for 16-bit code. ... bad command or filename ... Error: Invalid entry point offset ...
    (comp.lang.asm.x86)
  • Re: Cannot get exec syntax correct
    ... then run a system command against each file. ... > # define SAS command string ... > # glob files specified on the command line ...
    (comp.lang.perl.misc)