- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm trying to link a library to my fortran code in this way:
ifort main.f90 -o main -L/home/dirLib my_lib.a
I certainly know that my_lib.a is in that directory and there's no blank space between -L and the name of the directory but I receive this message
ld: my_lib.a: No such file: No such file or directory
Thanks
ifort main.f90 -o main -L/home/dirLib my_lib.a
I certainly know that my_lib.a is in that directory and there's no blank space between -L and the name of the directory but I receive this message
ld: my_lib.a: No such file: No such file or directory
Thanks
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a standard Unix/linux feature. -Lyourlibdir works with the special syntax -lyourlib, which searches for yourlibdir/libyourlib.a and libyourlib.so. In addition, linux ld doesn't handle non-standard variations in order of options. Details may be found in 'info ld'. If you don't want to use the -L syntax, you simply give the full path name of the library:
ifort -o main main.f90 /home/dirLib/my_lib.a
ifort -o main main.f90 /home/dirLib/my_lib.a
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot, now it works ok

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page