Silverfrost Forums

Welcome to our forums

compiling modules as separate files

7 Oct 2011 2:37 #9059

Hi,i usually compile everything in the ftn95 comand prompt with: ftn95 filename/lgo however now i want to put a subroutine in the module and the module in the separate file. there are no errors but compilation is abandoned,i have to link somehow these 2 files together,what should i do?thanks

7 Oct 2011 3:47 #9067

You have to compile one file at a time (in the correct dependency order) then use SLINK to do the link (order of object files doesn't matter).

ftn95 module_file.f90 ftn95 program_file.f90 slink -out:program.exe module_file.obj program_file.obj

This generalises for more than 2 files in the obvious way.

This isn't documented very well in the Help file. There is no discussion about SLINK. If you type SLINK -help you will get a list of options.

Things are a little different if you are building for .NET as you need a different linker.

7 Oct 2011 4:11 #9068

that has really worked out,thanks alot

help is sometimes difficult to understand,luckily there is support

7 Oct 2011 5:12 #9069

Many users find it easier to create a project using Plato or Visual Studio.

Please login to reply.