Fortran Use C functions with Watcom Fortran

  • Thread starter Thread starter eddyq
  • Start date Start date
  • Tags Tags
    Fortran Functions
AI Thread Summary
Using C functions from Watcom Fortran involves understanding several key aspects of interfacing between the two languages. Important considerations include the calling convention for functions, the structural definition and memory representation of data types, and the argument structure, which pertains to how pointers and various data types (like chars, ints, doubles, etc.) are represented. The standard Windows approach for working with DLLs includes using LoadLibrary to load the DLL and GetProcAddress to retrieve function pointers. The referenced documentation provides insights into different calling conventions and emphasizes the need to convert data structures appropriately, especially when dealing with matrices, as their representation may differ between C and Fortran.
eddyq
Messages
8
Reaction score
0
Is there a way to use C functions from Watcom Fortran?
 
Technology news on Phys.org
Take a look at this:

ftp://openwatcom.mirrors.pair.com/archive/11.0c/docs/f77progguide.pdf

The key things just for future notice about using external DLL's written in any language are as follows:

1) Calling convention (for function)
2) Structural definition and memory representation
3) Argument structure (representation of pointers, and machine words like chars, ints, doubles, floats, longs, etc)

The windows standard way of dealing with DLL's is with LoadLibrary for loading the DLL and GetProcAddress to get the function pointer of the DLL.

I had a quick look at the book and it seems to cover the various calling conventions pretty well, but make sure you know how to convert between structures if say a matrix in C is not the same as a matrix in FORTRAN.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Replies
25
Views
3K
Replies
2
Views
1K
Replies
3
Views
677
Replies
4
Views
1K
Replies
20
Views
3K
Replies
2
Views
1K
Replies
3
Views
2K
Back
Top