- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could someone please give me an example of how to pass the address of a FORTRAN subroutine to a C program so that the C program can call the subroutine at a later time (e.g. a callback)? The C code is in a DLL that is linked into the FORTRAN model. The FORTRAN model calls the C code most of the time, but sometimes during a call to the C code, the C code will need to call one of the FORTRAN subroutines.
Thanks,
Brian
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's an example of how it should work on the Fortran side:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35971and here's a discussion of some false starts and corrections:
http://objectmix.com/fortran/353727-passing-pointer-function-using-iso_c_binding.html
and an actual example on the Fortran side
http://cims.nyu.edu/~donev/Fortran/F03GL/OpenGL_glut.f90
and a discussion on this forum including Windows issues
http://software.intel.com/en-us/forums/showthread.php?t=70235- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page