Probably my question is simple and I am sure that a good solution exist.
Windows XP and MVS 2005 are used with ROOT 5.12.0.
I create a dll library (libevents.dll) as it described and can load it from the interactive session using
gSystem->Load(“libevents.dll”) and use my class from it.
Now I want to create a stand-alone code using the class existing in libevents.dll to read the same data. Previosly using MVS 2003 I changed project to create the static library and linked it with the main code. It was not suitable but it worked. Now it works also but the size of the static library is huge. It is approximately in 10 times greater then it was with MVS 2003. Also when I change project DLL->LIB information about additional libraries is lost and it must be restored if I return project to DLL production. If I export the names from DLL by the standard way then it probably will not loaded from the interactive session.
Thus is it possible creating of the DLL library in one project that it will be used in the interactive session and will be loaded with stand-alone code. Or what you may recommend.
If I create DLL for the ROOT session then project probably does not export any names. In fact the LIB file is created but it does not help for the stand-alone code. It was included but linker does not resolve external class names presented in DLL and which could be used in the ROOT session.
Probably I must modify the MVS project but I do not know how.
Well, if it is a MSVC project, you have to explicitly define the exported symbols with __declspec( dllexport ). See MSVC doc :
You can declare C++ classes with the dllimport or dllexport attribute. These forms imply that the entire class is imported or exported. Classes exported this way are called exportable classes.
The following example defines an exportable class. All its member functions and static data are exported:
#define DllExport __declspec( dllexport )
class DllExport C
{
int i;
virtual int func( void )
{ return 1; }
};
Note that explicit use of the dllimport and dllexport attributes on members of an exportable class is prohibited.
Then symbols will be resolved (exported in libevents.lib) and still accesible through gSystem->Load(“libevents.dll”)