Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Intel Customer Support will be observing the Martin Luther King holiday on Monday, Jan. 17, and will return on Tues. Jan. 18.
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

Problem Passing Data Structure to Fortran DLL

New Contributor I

I'm trying to pass an integer and a data structure to a subroutine in an external DLL but I'm having a compiler problem with the data structure I'm trying to pass. The compiler error message is "Error #6633: The type of the actual argument differs from the type of the dummy argument [PDATA]" but I can't see why. The error message relates to the "CALL pMKL(1,pData)" line.

​I would also like to know how to avoid declaring my data structure twice.

Finally, is there an easier way to call a function in a DLL if the DLL and the calling program are both Intel Fortran?

My test source code is attached. I apologise in advance if this is a dumb question.

0 Kudos
2 Replies
New Contributor III

To avoid declaring twice use the IMPORT statement inside the astract procedure interface.

Even though you declarations match the compiler sees them as different declarations and hence the mismatched argument type.

New Contributor I

Thanks, that fixed it.