- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
in front i´m complete new with Fortran.
So my Problem is: We have an realy old Software Project. It was generatet with Compaq Visual Fortran 6.1 and includes Source Files in *.cpp and *.for.
From my point of view, it was extremly confortable to compile and Debug this Project in one step by pressing F5.
My question is: Is there a way to do the same with VisualStudio and IntelParallelstudio XE 2016?
In best case i would like to convert my Compaq c++ DSW to VisualStudio.
Until now i only found examples where a Fortran dll was use by a c++ Programm. IBut i would like to create a dll from c++ and Fortran sourcefiles.
Best
Daniel
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for this. In your snippets I overlooked something you missed. You need BIND(C) on the functions in the abstract interface. This explains both why SUBTRACT didn't work and why adding VALUE didn't work.
First, if you don't say BIND(C), then functions that return structures pass a hidden first argument for that. BIND(C) uses the C convention so that "small" structures can be returned in registers.
Second, VALUE means pass-by-value only for BIND(C) interfaces. Otherwise, it means pass a writable copy by reference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve, thank you for pointing out the missing BIND(C) attribute. Add and Subtract now work as advertised. I am still having some trouble with my Multiply function taking char * input. I assume this will mean TYPE (C_PTR) input but the attachment of this input to Fortran CHARACTER variables is eluding me. I have not given up yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For char*, declare the argument as CHARACTER, DIMENSION(*) and pass a character variable. It will pass the address of the variable. Don't forget about a NUL termination.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »