From: Jason Green Newsgroups: comp.os.msdos.djgpp Subject: Re: I don't understand the compiler...(semi-newbie) Date: Thu, 09 Mar 2000 23:00:03 +0000 Organization: Customer of Planet Online Lines: 50 Message-ID: References: <38C58257 DOT 17B9D688 AT myokay DOT net> NNTP-Posting-Host: modem-104.silicon.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news5.svr.pol.co.uk 952556982 5165 62.136.13.104 (8 Mar 2000 23:09:42 GMT) NNTP-Posting-Date: 8 Mar 2000 23:09:42 GMT X-Complaints-To: abuse AT theplanet DOT net X-Newsreader: Forte Agent 1.7/32.534 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com caramaith wrote: > first and furthermore big thx fly out to Jason, Eli, Damian and Robin > for helping me out understanding the compiling and linking process. I > could well read the hundreds of pages with command-line options, but > this newsgroup is there for giving quick help... thx again!!! Huh! You think 3 days to sort out a compile command is quick? > now I try to compile and link using: > > gpp -g Stack.o Video.o videostack.cpp -o videostack > > and the compiler flags an error saying > > videostack.cpp:10: 'Stack' undeclared(first use this function) > videostack.cpp:10: parse error before ';' > videostack.cpp:11: 'videoStack' undeclared(first use this function) > > .....which are errors occuring when trying to declare variables without > types, but I did include the "Stack.h" as well as stating when linking > the code. here's an output of the beginning of "videostack.cpp" > [snip incomplete code] > Did I miss out on something???? please help me (again as soon and as > professional as possible) ... thanks in advance... There is nothing obvious from what you posted that would cause those errors. The problem lies somewhere in the code you did not post. I suggest to compile also using the -Wall switch and compile just one file at a time. Try to isolate the problem by reducing the code until the errors go away. Based on what you posted, this should compile without error: // test.cpp #include #include "Stack.h" int main(){ Stack videoStack; videoStack.initialize(); } gpp -Wall -c test.cpp BTW, you might find some other groups useful if you have problems purely language related: alt.comp.lang.learn.c-c++ & comp.lang.c++