- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I have some compiled modules in a directory /home/mods/ and a program main.f90 that uses that modules in directory /home/programs.
When I type in the directory /home/programs
ifort -c main.f90 -I/home/mods/
everything goes ok but afterwards, when I try to create the executable file with
ifort -o main main.o -I/home/mods
it gives me undefined references to the modules. How can I create my executable?
Thanks to all
When I type in the directory /home/programs
ifort -c main.f90 -I/home/mods/
everything goes ok but afterwards, when I try to create the executable file with
ifort -o main main.o -I/home/mods
it gives me undefined references to the modules. How can I create my executable?
Thanks to all
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-I has no meaning when linking. You have to link against the .o files created when the modules were compiled. A common method is to insert the objects in a .a library and link to that.

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