Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!udecc.engr.udayton.edu!blackbird.afit.af.mil!ewilliam From: ewilliam@afit.af.mil (News System Account) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: DOS gcc (dj1bin) problems Message-ID: <1991Mar06.024852.23115@afit.af.mil> Date: 6 Mar 91 02:48:52 GMT References: <1991Feb21.194439.15443@cs.UAlberta.CA> <2340@p4tustin.UUCP> Organization: Air Force Institute of Technology Lines: 25 carl@p4tustin.UUCP (Carl W. Bergerson) writes: >After using errout to catch the volumnous output, it appeared that >gcc could not abide C++ style (//) comment strings. >I confirmed this fishy behavior with the following simple program. > #include > main() > { > exit( 0 ); > } >This generated about a dozen errors commencing with one that indicated >the compiler could not tolerate the // comments in the header file. My guess is that the above program was in a file with a '.c' extension. gcc (and most good C compilers) treat files according to their extensions -- in the case of GNU gcc, .c means plain C, .cc means C++, etc. In order to get gcc to accept C++ syle comments, you have to tell it that it is a C++ file! Ed Williams ewilliam@blackbird.afit.af.mil