- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
extern "C" __declspec(dllimport) void _stdcall EXAMPLE_mp_SQUARE(int *int_arg);
{
EXAMPLE_mp_NUM = 5;
EXAMPLE_mp_SQUARE(&EXAMPLE_mp_NUM);
}
INTEGER NUMBER
NUMBER = NUMBER * NUMBER
WRITE(*, *) NUM
END SUBROUTINE SQUARE
END MODULE EXAMPLE
Linking...
dfor.lib(DFORMAIN.OBJ) : error LNK2001: unresolved external symbol _MAIN__
Release/VF_MODdll.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
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
Linking...
--------------------Configuration: VC_ModuleExample - Win32 Release--------------------
Build : warning : failed to (or don't know how to) build 'C:Documents and SettingssaroshDesktopVC_ModuleExampleVF_ModDLLReleaseVF_ModDLL.lib'
Linking...
LINK : fatal error LNK1181: cannot open input file ".VF_ModDLLReleaseVF_ModDLL.lib"
Error executing link.exe.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No problem.
As you probably know, the calling .exe must be builtusing .lib file which came out as result of .dll compilation. In this case, there's no .lib file.
The most likely reason is that you did not export anything from the dll. Only symbols (routines, usually) which are explicitly exported from the dll may be called from outside world. The symbols can be exported via !DEC$ATTRIBUTES DLLEXPORT directive or by using .DEF file (see documentation). If nothing is exported, .lib is not produced.
[Tip: you can examine what is exported from a dll using dumpbincommand-line utility with /exports switch, or using more powerful "Dependency Walker" from CVF Program group]
You're exporting non-existing "dll_mod":
!DEC$ ATTRIBUTES DLLEXPORT :: dll_mod
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Compiling Fortran...
C:Documents and SettingssaroshDesktopVC_ModuleExampleVF_ModDLLdll_mod.f90
Linking...
Creating library Release/VF_ModDLL.lib and object Release/VF_ModDLL.exp
--------------------Configuration: VC_ModuleExample - Win32 Release--------------------
Linking...
cmain.obj : error LNK2001: unresolved external symbol _Example_mp_NUM
Release/VC_ModuleExample.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Message Edited by JugoslavDujic on 04-05-2004 05:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi JugoSlavDujic,
Thanks again for your help, my problems on that as well =)
Sarosh

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