PDA

View Full Version : dll_export 'ing a routine makes it unrecognizables by other routines in the project


ter
04-05-2004, 06:58 AM
I'm building fortran (f90) win32 dll ( no modules) - when declaring a routine in the package as dll_export other routines (in the same project) calling it, wouldn't recognize it. What's wrong ? I'm working with Visual .NET and tried various sorts of mixed language.
Also : using dll_export to a function is not working unless I add the keyword function to the dll_export declaration (the documentation does'nt show it).
Also, when calling a function dll_imported to another .NET fortran project (not from a module) it does'nt work (problems with decorations) as contrary to subroutine call.

tzeis
04-05-2004, 06:53 PM
I'm building fortran (f90) win32 dll ( no modules) - when declaring a routine in the package as dll_export other routines (in the same project) calling it, wouldn't recognize it. What's wrong ? I'm working with Visual .NET and tried various sorts of mixed language.
The problem is that the name of the exported routine gets decorated, but the procedure that is calling that routine doesn't know about the export or the decoration, so it tries to call the undecorated name. You should only export procedures that you know will be called from outside the DLL. Inside the DLL, if a procedure is calling something that has been exported, you will have to import it just as if it were in a separate DLL. This might cause a warning message to appear, but you can ignore it.

Also : using dll_export to a function is not working unless I add the keyword function to the dll_export declaration (the documentation does'nt show it).
I would need to see some example code in order to tell what is going on.

Also, when calling a function dll_imported to another .NET fortran project (not from a module) it does'nt work (problems with decorations) as contrary to subroutine call.
I would also like to see an example of this.