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 

ftn95 and microsoft linker problem

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





PostPosted: Mon Jan 30, 2006 4:12 am    Post subject: ftn95 and microsoft linker problem Reply with quote

I just started with fortran and tried a hello world prog.
The source is simple

program hello
write(*,*) 'Hello World!'
end program hello

It compiles with "ftn95 hello.f90" with no error and i get the hello.obj file. Then i tried to link it using the microsoft linker 7.1

link /MACHINE:X86 /SUBSYSTEM:CONSOLE "C:ProgrammeSalford SoftwareFTN95salflibc.lib" hello.obj

It fails with "unresolved external symbol: _mainCRTStartup". Do i need some more libs for the linker or have i missed something during compilation?

Any help is appreciated
RoM
Back to top
PaulLaidler
Site Admin


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

PostPosted: Mon Jan 30, 2006 11:01 am    Post subject: ftn95 and microsoft linker problem Reply with quote

RoM

You should use the Salford linker called SLINK for Win32 and DBK_LINK for .NET.

These are lauched automatically for you if you use either Plato3 or Visual Studio with the Salford plugin.

Regards
Back to top
View user's profile Send private message
Anonymous
Guest





PostPosted: Mon Jan 30, 2006 11:22 pm    Post subject: ftn95 and microsoft linker problem Reply with quote

Thanks for your reply. It works with the Salesford linker but i still wonder why the ms linker failes. There are no other librarys shipped with Salesford Compiler than the salflibc.lib. Are there any other librarys invovled in the linking process? Or do i have to add compiler/linker option to adress the entry point of my program?

RoM
Back to top
PaulLaidler
Site Admin


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

PostPosted: Tue Jan 31, 2006 12:59 am    Post subject: ftn95 and microsoft linker problem Reply with quote

RoM

You will find a full description of SLINK in the FTN95 help file (FTN95.chm). This includes a list of the libraries that are automatically scanned and a discussion about entry points (I think).

Regards
Back to top
View user's profile Send private message
Anonymous
Guest





PostPosted: Tue Jan 31, 2006 3:38 am    Post subject: ftn95 and microsoft linker problem Reply with quote

Thanks for pointing me into the right direction. I added the /entry:SALFStartup to the ms linker options and now it works. One problem solved and thousands more to come...

Thanks again, RoM
Back to top
Andrew



Joined: 09 Sep 2004
Posts: 232
Location: Frankfurt, Germany

PostPosted: Wed Feb 01, 2006 12:59 pm    Post subject: ftn95 and microsoft linker problem Reply with quote

Is there a particular reason to use the Microsoft linker over the Salford one? SLINK has been designed to work with Salford code and I suspect you may run into further problems when using Microsoft link.
Back to top
View user's profile Send private message
Anonymous
Guest





PostPosted: Wed Feb 01, 2006 1:40 pm    Post subject: ftn95 and microsoft linker problem Reply with quote

I have a calculation program that allows to add user defined routines via dll. To create the dll i have to link my .obj file with .lib files from the program. I kknow the required options for the ms linker and have a .def file for the exports. So i tried to use the ms linker and looked for a compiler for the fortran routine. My program suggestes Compaq V6 compiler but its no longer available and Intel V9 compiler costs way too much so i tried the salesford compiler. I havent managed to produce a working dll so far but at least i got no error messages during compilation and linking. I think my error is somewhere and sooner or later i will track it down. The main problem is i have very limited knowledge about dll compilation/linking and now i try to learn the very basics. If you got any good resources about that subject i would be glad to hear about.

RoM
Back to top
Anonymous
Guest





PostPosted: Thu Feb 02, 2006 3:34 am    Post subject: ftn95 and microsoft linker problem Reply with quote

I have a calcualtion program that allows to add user defined subroutines by dll. To build the dll i have to link my .obj file (fortran code) with the .lib files from the program. I know the required options for the ms linker and have .def file for the exports. All i need is a compiler for the fotran source. My program manual suggests Compaq V6 compiler but it CV6 is no longer available and Intel Visual Fortran compiler costs way too much. So i tried Salesford compiler. I have managed to produce a dll but it is not working (yet). I have very limited knowledge about dlls so i try to learn the basics now. Maybe it will help to track the problem. The FTN95 help file was very helpful but if you know some other good resources about this subject i would be glad to hear about.

RoM
Back to top
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