Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28381 Discussions

Problem Passing Data Structure to Fortran DLL

schulzey
New Contributor I
302 Views

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
Andrew_Smith
New Contributor III
302 Views

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.

0 Kudos
schulzey
New Contributor I
302 Views

Thanks, that fixed it.

0 Kudos
Reply