Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Can procedures returning ALLOCATABLE types be exported from a dynamic-link library (DLL)?

$
0
0

I'm in a time crunch and unsure in my current frame of mind as to where all I should look to understand this, so thought I'd ask here: can procedures returning ALLOCATABLE types be exported from a dynamic-link library (DLL)?

Consider the simple example below:

FUNCTION foo() RESULT(Message)

   !.. Function result
   CHARACTER(LEN=:), ALLOCATABLE :: Message

   Message = "Hello World!"

   RETURN

END FUNCTION foo

Can such a function be exported from a DLL and called from another program, say a Fortran console application?  I get a run-time library exception when I do so:

forrtl: severe (157): Program Exception - access violation
Image              PC        Routine            Line        Source
ntdll.dll          76F4E41B  Unknown               Unknown  Unknown
ntdll.dll          76F4E023  Unknown               Unknown  Unknown
kernel32.dll       757614AD  Unknown               Unknown  Unknown
...
...

Are function exports a no-no that is widely known, but about which I was unaware?

 


Viewing all articles
Browse latest Browse all 3270


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>