- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My build looks like:
G:\Desktop\Pearson>build
G:\Desktop\Pearson>rem Build script for Pearson
G:\Desktop\Pearson>deftofd resource.h resource.fd
G:\Desktop\Pearson>rc Pearson.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.17298
Copyright (C) Microsoft Corporation. All rights reserved.
G:\Desktop\Pearson>call cf pearsonglobals
G:\Desktop\Pearson>iFort /nologo -Od /traceback /c pearsonglobals.f90
G:\Desktop\Pearson>lib /nologo MyLib.lib pearsonglobals.obj
Replacing pearsonglobals.obj
G:\Desktop\Pearson>ifort /nologo /WinApp Pearson.f90 MyLib.Lib Pearson.res
MyLib.Lib(purge.obj) : error LNK2019: unresolved external symbol RANFGET referenced in function PURGE
MyLib.Lib(purge.obj) : error LNK2019: unresolved external symbol RANFPUT referenced in function PURGE
Pearson.exe : fatal error LNK1120: 2 unresolved externals
I don't know why the link step does not pick up MyLib.lib which is local to all the source codes. Below, I've had lib list all of its entries. The ranf.obj has 3 routines in it and it is encompassed by a module I call Random. The invoking routine, Purge, has a use statement invoking random. What am I doing wrong?
Thanks,
Brooks V
G:\Desktop\Pearson>lib /list mylib.lib
Microsoft (R) Library Manager Version 12.00.31101.0
Copyright (C) Microsoft Corporation. All rights reserved.
pearsonglobals.obj
purge.obj
TypeVII.obj
TypeV.obj
TypeIII.obj
TypeI.obj
LnGamma.obj
GetK.obj
Howe.obj
Van.obj
dographs.obj
dohisto.obj
getrs.obj
Horn.obj
zData.obj
Integrate.obj
TypeII.obj
TypeIV.obj
TypeVI.obj
TypeVIII.obj
ranf.obj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem isn't in your link step, it's at compilation time. If PURGE could see the declarations for RANFGET and RANFPUT in module RANDOM, their names would be decorated with the module name, unless there is a name= or ALIAS clause in their declarations. What happens if you put
USE RANDOM, ONLY: RANFGET, RANFPUT
among the USE statements of function PURGE? Does it compile without error?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem isn't in your link step, it's at compilation time. If PURGE could see the declarations for RANFGET and RANFPUT in module RANDOM, their names would be decorated with the module name, unless there is a name= or ALIAS clause in their declarations. What happens if you put
USE RANDOM, ONLY: RANFGET, RANFPUT
among the USE statements of function PURGE? Does it compile without error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No it doesn't
G:\Desktop\Pearson>cf purge
G:\Desktop\Pearson>iFort /nologo -Od /traceback /c purge.f90
purge.f90(8): error #5082: Syntax error, found IDENTIFIER 'RANFGET' when expecting one of: => ( :
Use Random, ONLY RANFGET, RANFPUT
-----------------^
compilation aborted for purge.f90 (code 1)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But I hadn't put a USE RANDOM in Purge and doinf so fixed the problem.
Thanks much,
Brooks V

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