www.delorie.com/archives/browse.cgi | search |
Message-ID: | <38748E6B.787F0BF6@wt.net> |
Date: | Thu, 06 Jan 2000 06:45:31 -0600 |
From: | Aaron Chernosky <chernobl AT wt DOT net> |
X-Mailer: | Mozilla 4.7 [en] (Win98; I) |
X-Accept-Language: | en,pdf |
MIME-Version: | 1.0 |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: C++, Multiple Files, Classes |
References: | <3873FF7B DOT DFB48EA2 AT wt DOT net> <387460b5 AT news DOT uni-bielefeld DOT de> |
NNTP-Posting-Host: | 216-119-162-34.ipset44.wt.net |
X-Trace: | 6 Jan 2000 06:43:44 -0600, 216-119-162-34.ipset44.wt.net |
Organization: | World Trade Network, Inc. (WT.net) |
Lines: | 46 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
I'm using DJGPP v2.02 with RHIDE v1.4... and it doens't compile... it gives me those errors... so your saying I should do the includes backwards? Include the cpp file in my main file and have the cpp include the header? Manni Heumann wrote: > > In article <3873FF7B DOT DFB48EA2 AT wt DOT net>, Aaron Chernosky <chernobl AT wt DOT net> wrote: > >I have a header file with a class declaration in it, for ex this: > > > > Did you try to compile this? On my system it compiles without complaints (if > you change the inlcude to include). What you are doing here is legal, but > really bad style. You should never include a source file, always include the > header files! > Btw: Which compiler are you using? Since when does gcc say "Error:" when it > encounters an error? > > >-- header.h -- > > > >class MyClass { > > public: > > MyClass(); > > ~MyClass(); > >}; > > > >#inlcude "header.cpp" > > > >-- header.cpp -- > > > >MyClass::MyClass() { } > > > >MyClass::~MyClass() { } > > > >---------------- > > > >When I include the header file into my main program and try to compile > >it, the error "Error: syntax error before '::'" numerous times, once for > >each function that's in the class. What is causing this? > > > > > >Aaron C > > -- > > Manni
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |