share header files with multile source files

Dear all,

i have been up to now writing multiple public image manipulation library ITK functions to external application. Everything worked
fine when i wrote the functions as separate header files and included them all in main source file.
Until i got an error message concerning internal heap limit with vc6 and i can not inrease the /zm option any more.
So i decided to make all the functions as separate source files and combine them all into one dll file.
But now in the main source file i need to define the header files for the external program , which contains all the type definitions and classes of that program. And yet i need to include those header files to individual itk function source files as well because otherwise those classes etc. are not recognized. And yet if i do include them i got an error message:

DiscreteGaussianFilter.obj : error LNK2005: _PlugInStartup already defined in ITKMain.obj

I would greatly
appreciate any advices! How to share header files without redefinitions? Or is this the correct
way to do this all whatsoever? And why does it complain about the heap limit, the final dll
is only less than 5 mb !?

I read this article
http://cplusplus.com/forum/articles/10627/
but these headers are not written by me (and they are huge) so
i dont want to change them since i probably do something wrong....

Thanks in advance!
That is a linker error. I would assume that PlugInStartup is a function - so according article 10627 you provide in the header file the prototype; i.e. function name and parameters but thats it ( no "{}").
If it is a global variable (uh oh) then it should be declared as "extern" in the header file to avoid that.

I would doubt that separating code to DLL would increase the heap space, that by the way nothing has to do with the DLL size but is the memory area allocated at runtime and is used to store dynamical data generated with the new operator.
Topic archived. No new replies allowed.