Re: Calling a fortran subroutine from Visual C++



"Ray J." <Ray J.@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:51F7C3A6-1708-40F7-ABB6-F96CBC142300@xxxxxxxxxxxxxxxx
>I have a C++ program written and compiled on Solaris 8 with gcc. With gcc
> lets me compile fortran code along with the C++ program to be able to call
> the fortran code as a subroutine. The specifications for this project
> have
> changed and I am porting the C++ code to Visual C++. Is there a way to
> call
> fortran code from a C++ program compiled with Visual C++?

It's not clear to me what tools you have. Do you have a Fortran compiler for
Win32? If you do, and if it allows you to build a DLL, then the expedient
thing to do is export your function from the DLL and to call it from a C++
executable. Assuming compatible types and calling conventions VC++ should
have no trouble calling into an external DLL.

I don't believe that MS sells a Fortran compiler. You will find some free
Fortran compilers here:

http://www.thefreecountry.com/compilers/fortran.shtml

though I should tell you that I have no experience with any of them.

Regards,
Will



.



Relevant Pages

  • Re: g77 mex problem under win
    ... in emacs I hit C-c C-c RET. ... It does not and it is mainly fortran code. ... gcc is a compiler suite and the name of the c compiler ...
    (comp.soft-sys.matlab)
  • Re: A question on Newtons Method
    ... >> I can't believe you'd advise a noob to use a compiler which is still ... > production codes and codes from textbooks. ... > The Fortran standard generally does not specify the required behavior ... >> another important class of hassle which most numerical programmers ...
    (sci.math.num-analysis)
  • Fortran Resources (June)
    ... and the standard for the Fortran language and its derivatives. ... WHERE CAN I OBTAIN A FORTRAN 95 COMPILER? ... Absoft Fortran compilers, debuggers, and development tools for Windows, ... are available for Linux systems. ...
    (comp.lang.fortran)
  • Fortran Resources (July 2004)
    ... and the standard for the Fortran language and its derivatives. ... WHERE CAN I OBTAIN A FORTRAN 95 COMPILER? ... Absoft Fortran compilers, debuggers, and development tools for Windows, ... are available for Linux systems. ...
    (comp.lang.fortran)
  • Fortran Resources (August 2004)
    ... and the standard for the Fortran language and its derivatives. ... Absoft Fortran compilers, debuggers, and development tools for Windows, ... and Linux include source-compatible Fortran 95 compiler suites ... are available for Linux systems. ...
    (comp.lang.fortran)