Mail Archives: djgpp/1997/07/25/14:19:21
Thomas_Christensen AT bc DOT sympatico DOT ca (Thomas Christensen) wrote:
> I am using RHide 1.3.
Cool ;-)
> I am writing an application and wish to use several files to keep
> things neat. My problem is when I compile the individual files any
> file that uses a class defined in another file gives me an error. If I
> include the file with the class I am including the application will
> compile without an error but when it links I get an error that there
> are multipal definitions of the classes. What do I have to do to tell
> a file about a class defined in another file?
Thomas you must learn a little more about C++, anyways here is a little
explanation:
1) Declare the classes on headers (.h files). One header per class if possible.
2) Make the implementation of the classes in .cc files. These files must
include the needed header/s. All the member functions must be in the .cc file
NOT in the .h file. Exception: inline members like that:
int XXXXX(int a) {foo=a;};
3) Link all the files together using a RHIDE project. List ALL the .cc in the
project (no .h in projects).
SET
------------------------------------ 0 --------------------------------
Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013
- Raw text -