Silverfrost Forums

Welcome to our forums

DLL Exports

31 Dec 2009 7:32 #5630

I've built a Win32 DLL that contains several internal subroutines and functions, and everything appears to be working fine. In the Linker options, I've answered 'Yes' to 'Export All'.

My question deals with how to export (make visible) only one or two of the subroutines. When I answer 'No' to 'Export All', I don't see a way to specify individual subroutine or function names in the Linker options. How do I do this?

1 Jan 2010 8:13 #5632

The form of the SLINK commmand line command for exporting a particular routine is

-export:entryname

where entryname is the name of the routine (uppercase). Each item in the list can be separated by a space.

Try

-export:entryname1 -export:entryname2

You could also see if the following works

-export:entryname1,entryname2

For details see the FTN95 help file under Win32 Platform->Using the linker->Reference->Command line mode.

In Plato and Visual Studio this list can be inserted in the Project Properties under Linker Options then Extra linker options.

If you have any problems then use SLINK from a command line first and then adapt the result to Plato or Visual Studio.

As a future development we could introduce a comment embedded directive into the Fortran code so that the IDE could do this automatically for you.

1 Jan 2010 7:26 #5634

Entering this in the Extra Linker Options (in Visual Studio) is exactly what I was looking for, and had tried, but I had the syntax wrong. I didn't realize that I had to put a dash ('-') in front of the word export, and I didn't realize I couldn't simply make a list of exports separated by commas. So the syntax of: '-export:entryname1 -export:entryname2' worked pefectly.

Thank you, and Happy New Year!

Please login to reply.