Unknown (?) Feature - EXPORT attribute instead of EXP file

Yes. These settings can be set/clear on the Compiling tab of the Project Properties dialog.

These settings can be cleared in the CWPROJ file by adding

<dynamic_base>False</dynamic_base>
<dep>False</dep>

lines in the PropertyGroup block for corresponding (Release or Debug) configuration.

2 Likes

When one is on line 12, and the other is line 200, the love affair is over. :slight_smile:

Maybe 2 incs would work more betterly? Then it would be simple to write a utility to comment out the EXPORT and save to a new .INC

I think I could find that workable, maybe.

Having 2 almost identical INC files seems ugly. How do you feel about more symbols? I had posted this example that added EXPORT when _Link_=>1always

   COMPILE('** Internal **',_Link_)   !Compiles when _Link_=>1
MyClass CLASS,TYPE,MODULE('My'),LINK('My',_Link_),DLL(_Dll_), EXPORT
   ** Internal **

   COMPILE('** External **',_Dll_)   !Compiles when _Dll_=>1
MyClass CLASS,TYPE,MODULE('My'),LINK('My',_Link_),DLL(_Dll_)   ! No => EXPORT
   ** External **

That’s bad to assume Link(,1) Classes are always exported. Most classes with templates have Multi-DLL criteria that allows selecting if they are Exported.

So to do it right I think there would need to be a _MyExport_ symbol like this:

   COMPILE('** Exported **',_MyExport_=1 and _MyLink_=1 )   
MyClass CLASS,TYPE,MODULE('My'),LINK('My',_MyLink_), EXPORT
   ** Exported ** 

   OMIT('** Do Not Export **',_MyExport_=1 and _MyLink_=1 )   !Compiles when _MyLink_ <> 1 OR _MyExport_ <> 1
MyClass CLASS,TYPE,MODULE('My'),LINK('My',_MyLink_),DLL(_MyDll_)   ! No => EXPORT, might be External
   ** Do Not Export **   

__

So it takes 3 symbols to have a CLASS with EXP entries for EXPORT “handled” by the build. When dealing with a lot of Symbols I find it easier to create .PR project files instead of using the Project Defines:

-- Include has All Class Link/DLL as External (including this class) --
#include Dll_eic_XclassX.Defines.PR

-- Set This Class as Linked True (overrides above include) --
#pragma define(_E_str_L_=>1)
#pragma define(_E_str_D_=>0)

I think you made a good argument for 2 files. :slight_smile:

Basically, one INC for the project that exports the class (which can reside in the project folder itself). And another inc for all of the consumers. All you ever work on manually is the export INC. Then allow your utility to create the public one.

That turns “many” manual actions into very few. The utility would help mitigate mistakes, as well.

1 Like