From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: how to compile c++ program Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: References: X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 43 X-Trace: +r4CDjhdAqA03iqdDK9kk1biqvPQPRwcIlbXUMuJOAa10YwQGxkikIwj/QtwrdMvABZYet9rhOPw!9PRUDVQTULnwE6j032ESrUEuW0oHbzJXgy4McZ3mgBcLcmipDNaEP/dtVhVeQyE3ryGlDfmPSQ== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Sat, 05 Feb 2000 18:37:49 GMT Distribution: world Date: Sat, 05 Feb 2000 18:37:49 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Sat, 5 Feb 2000 19:12:52 +0200, "mukt1000" wrote: >Hi, > I 'm a new c programmer, I use Djgpp (v2.02) and now I want to jump c++ , > I know Djgpp is already a c++ compiler,but I cant even compile a hello >world program with it; > > // hello.cpp GCC (the compiler in DJGPP) likes C++ files to be named *.cc not *.cpp > #include Nowadays, it's normally done: #include // note: no .h using namespace std; // namespaces are a new feature in C++ > void main () The first line of main() should always be one of these two lines: int main(void) int main(const int argc, const char **argv) > { > cout<<"helo world"; file://or printf("hello world"); The file:// problem can be fixed by leaving a space after // comments. It's a bug in your newsreader (Outhouse Express). > } > > command line: d:\djgpp\bin:\> gcc hello.cpp produces lots of errors; > I tried all of the possibilities but compiler doesnt compile cpp files. Try using gxx instead of gcc to compile your C++ programs. gxx hello.cc -o hello.exe -- Damian Yerrick http://yerricde.tripod.com/ Comment on story ideas: http://home1.gte.net/frodo/quickjot.html AOL is sucks! Find out why: http://anti-aol.org/faqs/aas/ View full sig: http://www.rose-hulman.edu/~yerricde/sig.html