Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

mystery: How to use a module In a DLL?

rahzan
New Contributor I
363 Views
I've written a a DLL containing a single module, Now I can't figure out what DLLIMPORT statements are needed to use the dang thing. I've put in the lib filename in the link settings of the project.
The mod & lib files are in the project directory.

If put in the USE statement by itself, it complains about unresolved externals.
Inclduing the DLLIMPORT,results in the "attributes" of individual var's conflicting with that in USE.
If I put in DLLIMPORT by itself it really blows gas... and DLLIMPOIRT on the module name itself seems out of the question!
Is this even supposed to be possible?

Please note the (?)'s

in CLIENT
use M (?)
!DEC$ DLLIMPORT A,B (?) !how does it know which DLL to get these from?
!DEC$ DLLIMPORT X (?)
allocate (A(n))
call X
...

in DLL:
module M !(is there a dllexport statement needed for M?)
real, allocatable:: A(:) ! the client will allocate this, is this form ok(?)
dllexport A (?)
integer B !(what is the export statment for A and B??)
dllexport B (?)

contains
subroutine X
dllexport X ! I assume this is correct as usual (?)
end sub X
end module
0 Kudos
0 Replies
Reply