From: Uno on 10 Apr 2010 18:41 Craig Powers wrote: [x-posting again as in original post] > Uno wrote: >> $ gfortran -llibposix90.a blev1.f90 -o out >> /usr/bin/ld: cannot find -llibposix90.a >> collect2: ld returned 1 exit status > > A standard feature of Unix-derived operating systems is that when > specifying a library to a compiler via the '-l' switch, the leading > 'lib' is omitted (as is the extension). Thus, the correct form of this > command line would be, > gfortran -lposix90 blev1.f90 -o out $ gfortran -o out blev1.f90 libposix90.a works. $ gfortran -lposix90 blev1.f90 -o out /usr/bin/ld: cannot find -lposix90 collect2: ld returned 1 exit status $ ls * blev1.f90 ChangeLog f90_unix_dirent.mod libposix90.a Makefile~ text1 blev1.f90~ COPYING INSTALL Makefile README .... lib: libposix90.a text1.txt It doesn't want to find it. ?? > > (assuming that libposix90.a is in the default library search path for > gfortran... if it is and it's not being found, you may wish to try > running ldconfig, otherwise you may wish to use the -L switch to > instruct gfortran to search in that location in addition to the default > search path.) Since the original post, the kinks have been worked out on the fortran side of it, and I'm left with questions having to do with the platform, hence the x-post. It looks to me like ldconfig is looking only one place for libraries: $ ldconfig -p >text4 739 libs found in cache `/etc/ld.so.cache' libzephyr.so.3 (libc6) => /usr/lib/libzephyr.so.3 libz.so.1 (libc6) => /lib/libz.so.1 libx264.so.65 (libc6) => /usr/lib/libx264.so.65 libx86.so.1 (libc6) => /lib/libx86.so.1 libxvidcore.so.4 (libc6) => /usr/lib/libxvidcore.so.4 I've read the man pages for ld and ldconfig and have the headache to prove it. What is ldconfig supposed to do? -- Uno
From: Alan Curry on 10 Apr 2010 19:44 In article <82cd4vFiscU1(a)mid.individual.net>, Uno <merrilljensen(a)q.com> wrote: |Craig Powers wrote: | |I've read the man pages for ld and ldconfig and have the headache to |prove it. What is ldconfig supposed to do? fortran is Greek to me, but I can provide a simple answer to that one: in its most common usage, ldconfig notifies the system that a new library has been installed in /usr/lib so that the dynamic linker will be able to find it when it's needed. It could also be used when other changes are made to the system's shared libraries (one got a removed, or the directory list in /etc/ld.so.conf has been modified). It has no effect at all on the linking of lib*.a libraries, or anything else that happens at build time. That's what -L is for. -- Alan Curry
|
Pages: 1 Prev: Newbie: setting variable before command execution Next: Stuck on a very basic regex. |