- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi,
my problem is that the linker fails with:
ld: library not found for -llibfparser.a
when I use:
ifort -L/usr/local/lib/ -I/usr/local/include/fparser-v1.1/ -llibfparser.a test.f90
if I compile specifying the complete path all is OK
ifort -I/usr/local/include/fparser-v1.1/ /usr/local/lib/libfparser.a test.f90
this gives me the correct executable file.
There are two modules that are correctly seen through the -I switch what seems to not work is the -L switch.
Thanks
(sorry for my English)
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
The convention used by the Linux linker ld for specifying library files is that the library file name is obtained by adding the prefix lib and adding the suffix .a to the ld argument prefixed by -l. Thus, -lmath is shorthand for libmath.a .
For more details of the -l command line option, see https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_mono/ld.html#SEC3 .
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
try ordering -L and -l together like this:
ifort -I/usr/local/include/fparser-v1.1 -L/usr/local/lib -llibfparser.a test.f90
-L sets a library path and usually immediately preceeds the -l libraries.
Let me know if this works.
Ron
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
The convention used by the Linux linker ld for specifying library files is that the library file name is obtained by adding the prefix lib and adding the suffix .a to the ld argument prefixed by -l. Thus, -lmath is shorthand for libmath.a .
For more details of the -l command line option, see https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_mono/ld.html#SEC3 .
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Thanks Ron, but unfortunately nothing changes, I still have ld: library not found for -llibfparser.a.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Thanks mecej4, it works!
ifort -L/usr/local/lib/ -I/usr/local/include/fparser-v1.1/ -lfparser test.f90
Eva
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Well, now from the terminal everything works but from xcode I continue to have the usual error.
In Targets --> Build Phases --> Link Binary With Libraries I have added libfparser.a and I also tried changing the name to fparser but the problem remains.
Obviously I set the directory for the .mod file and for the library:
Build Settings --> Search Paths --> Header Search Paths --> /usr/local/include/function_parser/
Build Settings --> Search Paths --> Library Search Paths --> /usr/local/lib/
Ideas?
Thanks Eva
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
I do not have a Macintosh and cannot help you with Xcode. I do not understand what you mean by "the usual error".
Do note that Xcode is deprecated with the current compiler release, and will be unsupported in a future release, according to https://software.intel.com/en-us/forums/intel-fortran-compiler/topic/844666 .
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
"the usual error" is:
ld: library not found for -llibfparser.a
Another question, if Xcode is deprecated what IDE is available for MacOS? Eclipse, Visual Studio Code ...
Thanks Eva
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
gragnani, eva wrote:"the usual error" is:
ld: library not found for -llibfparser.a
In the place where you entered "libfparser.a" in Xcode, enter "fparser".
gragnani, eva wrote:
Another question, if Xcode is deprecated what IDE is available for MacOS? Eclipse, Visual Studio Code ...
Whatever is available for MacOS. Someone else who is a Macintosh user will have to help you on that.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Thanks for the reply macej4, but the problem is that xcode has a dialog box for loading a file (that is the library) and doesn't allow you to specify a name.

- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite