- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On the Mac, are there Fortran commands loadlibrary, freelibrary, and getprocaddress to dynamically load a user supplied C++ dynamic library? On Windows the program uses, "use kernel32" to access the WinAPI. Does it need to include a compiler option?
Is there any sample code / examples / test cases to illustrate dylibs? Can you point me to the right place in the Intel / Apple documentation for dylibs? Has anyone written a "for dummies" book on the subject? :-)
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LoadLibrary, etc. are not "Fortran commands". They are Windows operating system routines and do not exist on operating systems other than Windows. "use kernel32" is the way in Intel Visual Fortran to declare the routines so that you can call them. This does not map directly onto anything on MacOS.
On Linux and MacOS, there are usually a set of C library routines that may do some of the things you're looking for. "dlopen" is probably the one to look for. Intel Fortran does not provide canned declarations of these routines, but you can use the C interoperability features to write your own declaration.
To get started, see this Wikipedia article on dynamic loading.
On Linux and MacOS, there are usually a set of C library routines that may do some of the things you're looking for. "dlopen" is probably the one to look for. Intel Fortran does not provide canned declarations of these routines, but you can use the C interoperability features to write your own declaration.
To get started, see this Wikipedia article on dynamic loading.

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