- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To have explicit interfaces I put all the subroutines and functions of my program inside MODULE SUBPROGRAMS, but got LNK2019 errors like:
TEMP.obj : error LNK2019: unresolved external symbol _F1 referenced in function
_SUBPROGRAMS_mp_VA1.
F1 and VA1 are function and subroutine in respect, and temp.f is compiled on 32 bit platform.
Any advice would be very much appreciated.
Hamid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Remove all declarations of the module procedures in other program units - let the module serve as the declaration.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many thanks Steve but Ive never done that. Could you explain more or make an example please.
I have to leave my office now so will reply you tomorrow if required.
Hamid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are building from the command line, you'd do something like this:
ifort -c modulefile.f90
ifort mainprog.f90 modulefile.obj
If this doesn't help, please show me how you are building the application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Many thanks again. All the sources were in temp.f and I used the command line to compile it (ifort temp.f)when got the errors.
Now if I separate the modules and the main program into tempM.f and tempP.f and compile with the commands you said, I get the same errors.
ifort c tempM.f
ifort tempP.f tempM.obj
The problem is solved when in temp.f I put all the functions inside the source of the program and keep just the subroutines in module SUBPROGRAMS.
Hamid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am attaching a self-contained test. The entire source is in tempS.f, and the module and the program are pastedto tempMS.f and tempPS.f
The error I am getting now is:
tempS.obj : error LNK2019: unresolved external symbol _CRACK referenced in funct
ion _SUBPROGRAMS_mp_MESH
tempS.exe : fatal error LNK1120: 1 unresolved externals
Hamid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Remove all declarations of the module procedures in other program units - let the module serve as the declaration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you could solve the problem. Many many thanks.
Hamid

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