View previous topic :: View next topic |
Author |
Message |
umike
Joined: 19 Sep 2011 Posts: 4
|
Posted: Fri Oct 07, 2011 3:37 pm Post subject: compiling modules as separate files |
|
|
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 |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Fri Oct 07, 2011 4:47 pm Post subject: |
|
|
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. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
umike
Joined: 19 Sep 2011 Posts: 4
|
Posted: Fri Oct 07, 2011 5:11 pm Post subject: |
|
|
that has really worked out,thanks alot
help is sometimes difficult to understand,luckily there is support |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Fri Oct 07, 2011 6:12 pm Post subject: |
|
|
Many users find it easier to create a project using Plato or Visual Studio. |
|
Back to top |
|
 |
|