L
Leslaw Bieniasz
Cracow, 15.09.2004
Hi,
I am writing a big C++ project using BCB 4.0. The project
consists of several dlls and exes. Each of the dll
is composed of several units (that is cpp files with corresponding h files)
containing:
1) ordinary C++ classes or functions,
2) class templates or function templates.
I want the code for templates to reside within the dlls,
by using appropriate instantiated template declarations within the
source for the dlls.
The dlls may be called by each other, not only by the exes.
After struggling with many problems my project is currently working,
but I am not fully satisfied and not sure whether I do everything correctly.
In particular, I am not sure about what is the orthodox and most elegant
way of organising the structures of the particular dll subprojects.
I have a permanent difficulty with deciding where (in which files) to
#define all necessary macros like those representing _declspec needed in dlls,
which files to #include and where, and where and under which conditions
to place the instantiated template declarations. Furthermore, I often
have an additional complication resulting from the cross-use of classes
(for example a class template A calls methods of the class template B
by a pointer to B kept in A, and simultaneously class template B calls
methods of class template A by a pointer to A, kept in B), which makes
troubles if the various files are not properly #included. Finally,
I am not sure how to set up a header file for a dll, that will
be #included in calling dlls or exes. Should it contain a list
of #includes of all header files to be exported?
Among other things, I would like to avoid unnecessary #includes and make
the compilation sequence more transparent and efficient.
Can anyone supply me with a complete explanation of how all the above
should be done properly?
Sincerely,
L.B.
*-------------------------------------------------------------------*
| Dr. Leslaw Bieniasz, |
| Institute of Physical Chemistry of the Polish Academy of Sciences,|
| Department of Electrochemical Oxidation of Gaseous Fuels, |
| ul. Zagrody 13, 30-318 Cracow, Poland. |
| tel./fax: +48 (12) 266-03-41 |
| E-mail: (e-mail address removed) |
*-------------------------------------------------------------------*
| Interested in Computational Electrochemistry? |
| Visit my web site: http://www.cyf-kr.edu.pl/~nbbienia |
*-------------------------------------------------------------------*
Hi,
I am writing a big C++ project using BCB 4.0. The project
consists of several dlls and exes. Each of the dll
is composed of several units (that is cpp files with corresponding h files)
containing:
1) ordinary C++ classes or functions,
2) class templates or function templates.
I want the code for templates to reside within the dlls,
by using appropriate instantiated template declarations within the
source for the dlls.
The dlls may be called by each other, not only by the exes.
After struggling with many problems my project is currently working,
but I am not fully satisfied and not sure whether I do everything correctly.
In particular, I am not sure about what is the orthodox and most elegant
way of organising the structures of the particular dll subprojects.
I have a permanent difficulty with deciding where (in which files) to
#define all necessary macros like those representing _declspec needed in dlls,
which files to #include and where, and where and under which conditions
to place the instantiated template declarations. Furthermore, I often
have an additional complication resulting from the cross-use of classes
(for example a class template A calls methods of the class template B
by a pointer to B kept in A, and simultaneously class template B calls
methods of class template A by a pointer to A, kept in B), which makes
troubles if the various files are not properly #included. Finally,
I am not sure how to set up a header file for a dll, that will
be #included in calling dlls or exes. Should it contain a list
of #includes of all header files to be exported?
Among other things, I would like to avoid unnecessary #includes and make
the compilation sequence more transparent and efficient.
Can anyone supply me with a complete explanation of how all the above
should be done properly?
Sincerely,
L.B.
*-------------------------------------------------------------------*
| Dr. Leslaw Bieniasz, |
| Institute of Physical Chemistry of the Polish Academy of Sciences,|
| Department of Electrochemical Oxidation of Gaseous Fuels, |
| ul. Zagrody 13, 30-318 Cracow, Poland. |
| tel./fax: +48 (12) 266-03-41 |
| E-mail: (e-mail address removed) |
*-------------------------------------------------------------------*
| Interested in Computational Electrochemistry? |
| Visit my web site: http://www.cyf-kr.edu.pl/~nbbienia |
*-------------------------------------------------------------------*