Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26732 Discussions

Problem Passing Data Structure to Fortran DLL

schulzey
New Contributor I
99 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
99 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.

schulzey
New Contributor I
99 Views

Thanks, that fixed it.

Reply