- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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)
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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 .
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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 .
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Thanks Ron, but unfortunately nothing changes, I still have ld: library not found for -llibfparser.a.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Thanks mecej4, it works!
ifort -L/usr/local/lib/ -I/usr/local/include/fparser-v1.1/ -lfparser test.f90
Eva
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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 .
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
"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
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.
