forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compiling modules via a relative path

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
Ryan



Joined: 25 Feb 2016
Posts: 78

PostPosted: Sun Oct 13, 2019 4:41 pm    Post subject: Compiling modules via a relative path Reply with quote

When compiling a basic programme with a module from another directory, the module is included (and found) by the compiler but the functions within are not accessible and the compiler complains.

When copying the module source to the same directory and referencing it direct, all works as expected.

For example the following fails;

Code:
ftn95 ..\CommonModules\Whatever.f95
ftn95 MainApp.f95 /link /debug


With 'WARNING the following symbols are missing:' etc.

Copying Whatever.f95 to the current directory and using;

Code:
ftn95 Whatever.f95
ftn95 MainApp.f95 /link /debug


Works fine and the executable can be run.

What dumbness am I doing?

FYI: This is for a common module that is used amongst several projects, I really don't want to copy and paste. I can use a symlink if this cannot be worked around, but they have their own problems.

Thanks in advance,

Ryan
Back to top
View user's profile Send private message
Robert



Joined: 29 Nov 2006
Posts: 277
Location: Manchester

PostPosted: Sun Oct 13, 2019 5:52 pm    Post subject: Reply with quote

I am guessing here that Whatever.obj is in ..\CommonModules but the .mod file is placed in the current directory.
Back to top
View user's profile Send private message Visit poster's website
Ryan



Joined: 25 Feb 2016
Posts: 78

PostPosted: Sun Oct 13, 2019 7:04 pm    Post subject: Reply with quote

Correct. The module can be found in the local directory, but is somehow corrupted.

I've not got out a hex editor yet to see the difference, they both are 1kb so look similar (I've not got the byte count handy).
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6076
Location: Salford, UK

PostPosted: Sun Oct 13, 2019 7:07 pm    Post subject: Reply with quote

When you compile a module then this normally yields two types of file, .mod and .obj files (or their 64 bit equivalents) in the same folder.

FTN95 needs to "see" the .mod file when it encounters the corresponding USE statement. The linker needs to scan the .obj file when linking.

You can use /mod_path to access .mod files in a different folder. You can also tell the linker where to find the .obj files but in this case it needs help.

One approach is to do no copying and to use /mod_path when compiling and a link script or LIBRARY directive for linking.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1227
Location: Aerospace Valley

PostPosted: Fri Oct 18, 2019 12:05 am    Post subject: Reply with quote

'Tw'ud be good to add a set of examples of these compile/link instructions to the relevant section(s) in the manuals.
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group