Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner

conditional compilation of DLLEXPORT attribute

I have a library of routines from which I create an object library (.lib)  and a DLL (.dll).

I currently use a custom pre-processor which removes the  "!DEC$ATTRIBUTES DLLEXPORT :: name"  statements, (and one or two other DLL-specific statements), when I am compiling for the object library.

I am wondering if I can avoid using a pre-processor.

Would it matter if I left the "!DEC$ATTRIBUTES DLLEXPORT :: name" statements in when compiling for the object library?

 

0 Kudos
2 Replies
Highlighted

Having DLLEXPORT directives

Having DLLEXPORT directives in code not built into a DLL is "mostly harmless". The code will work fine, but the linker will create an export library when the executable is linked, which may be annoying.

Retired 12/31/2016
0 Kudos
Highlighted
Black Belt

You could use module

You could use module definition files or command line options to specify the procedures to export, as an alternative to DLLEXPORT directives.

0 Kudos