- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i've a function in a module which i want to export. till now, i was using dllexport method. but this method works well on functions that are not in a module. i noticed that module functions are exported with a prefix of the module name (like modname..functionname) this is not sth. idesire.
ifmay i give an example;
Code:
function Add(x,y) !DEC$ ATTRIBUTES DLLEXPORT::Add implicit none integer(4) :: x,y,Add Add=X+y end function module modSample contains function Minus(x,y) !DEC$ ATTRIBUTES DLLEXPORT::Minus implicit none integer(4) :: x,y,Minus Minus=x-y end function end module
when i compile this dll, and have a look in it with dependency walker, i see that two functions are exported,
Add
modSample..minus
how can i change the name of "modSample..minus" to only "minus"
any help would be appreciated. thanks in advance
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
!DEC$ ATTRIBUTES ALIAS:"MINUS" :: MINUS
You may want to add "decoration" (leading underscore) as required by whatever is calling the routine.
You may want to add "decoration" (leading underscore) as required by whatever is calling the routine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
dear sblionel;
Could you please give a.def samle for the same project ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why a .def file? Using the attributes is better. You'll need the ALIAS attribute anyway. It's not clear what you want from a .def file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want .def file because i've lot's of functions to edit (100+). With a .def file it may be easier to determine the exported functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can read about the syntax of .def files in the MSDN documentation. I think you would do something like:
EXPORTS
ADD=MODULENAME_mp_ADD
but you'll have to experiment to see if you get the right effect.
EXPORTS
ADD=MODULENAME_mp_ADD
but you'll have to experiment to see if you get the right effect.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page