From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Still trying with OOP in DJGPP Date: Tue, 21 Apr 1998 18:59:43 -0400 Organization: Two pounds of chaos and a pinch of salt. Lines: 58 Message-ID: <353D24DF.719F@cs.com> References: <353CF58E DOT CAC7C9A3 AT seric DOT es> NNTP-Posting-Host: ppp246.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk loren wrote: > > DJGPP gives me this error: "parse error before 'class'" or something > like this ... > Maybe i have to install some additional packages for doing OOP ... > I don't know ... > Any1 can help me, pliz? It seems you're a bit confused about what a programming language is. Let me try to help. DJGPP is a development environment that supports multiple programming languages. The basic compiler supports the C language, and you can add on additional modules to allow compilation of C++, Objective C, Fortran, Pascal, and several others. C is a procedural language. C++ is an object-oriented language derived from C syntax. The two are not the same. Neither does the term "OOP" (Object Oriented Programming) denote any specific language. It merely describes a set of features that all OO (Object Oriented) languages should have in common. There are dozens of OO languages, such as C++, Ada, Java, etc. To compile C++ programs, you also need to download the C++ compiler, which is contained in two zipfiles. If you already downloaded v2gnu/gcc2721b.zip, then you must get v2gnu/gpp2721b.zip and v2gnu/lgp271b.zip. If you already downloaded v2gnu/gcc280b.zip, then you need v2gnu/gpp280b.zip and v2gnu/lgpp280b.zip. These packages are installed in the same manner as the rest of the DJGPP packages. Once the appropriate packages are installed, you must give the compiler some way to know whether your program is to be compiled as C or C++. C files end in the extension .c, i.e., "myprog.c", "dothis.c", etc. The case of the extension is important. C++ files may end in several extensions: .C (note uppercase C), .cc, .cpp, and .cxx. Examples: "oop.C", "program.cc", "hello.cpp", "dothat.cxx". If you give the compiler a file with the correct extension, it will compile your program properly. If you don't, it has no way to tell that you really meant a C++ program, and it will refuse to compile it. If you still don't understand, please try to find a more appropriate source of teaching, such as a class or a C++ textbook. It's very difficult to teach basic programming via email. hth! -- --------------------------------------------------------------------- | John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com | | "Starting flamewars since 1993" | http://www.cs.com/fighteer/ | | *** NOTICE *** This .signature | ICQ UIN#: 7406319 | | is generated randomly. If you don't like it, sue my computer. | ---------------------------------------------------------------------