- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have MS Visual Studio.NET 2003 with Intel Fortran Compiler Integration.
I have a large Fortran Program (Console Application) and I want to write a single subroutine (or function) in c++.
This subroutine shall be called by the Fortran Program.
How must I proceed?
Must I make a second (C++-) Project? What sort of Project?
How do I link that subroutine into my Fortran Program?
Say, for example, this is my Fortran code:
MixFortran.f90
!
! FUNCTIONS:
! MixFortran - Entry point of console application.
!
!****************************************************************************
!
! PROGRAM: MixFortran
!
! PURPOSE: Entry point for the console application.
!
!****************************************************************************
program MixFortran
implicit none
real a,b,c,d
real fsumme
external fsumme
a=4.
b=5.
c=6.
d=fsumme(a,b,c)
write(6,*)d
stop
end program MixFortran
The function "fsumme" simply calculates the sum of the three arguments.
How must I proceed to write the Function "fsumme" in c++ and to
link it to a running exe?
Link Copied
0 Replies

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