From: broeker AT acp3bf DOT knirsch DOT de (Hans-Bernhard Broeker) Newsgroups: comp.os.msdos.djgpp Subject: Re: compilation problem at link stage Date: 20 Dec 1999 12:45:07 +0100 Organization: RWTH Aachen, III. physikalisches Institut B Lines: 24 Message-ID: <83l4s3$o77@acp3bf.knirsch.de> References: NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 945690311 13122 137.226.32.75 (20 Dec 1999 11:45:11 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 20 Dec 1999 11:45:11 GMT X-Newsreader: TIN [version 1.2 PL2] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Niel de Beaudrap (bjde AT ucalgary DOT ca) wrote: > I'll keep this short -- one source, one class "__2nybs" (not that the name > is likely to matter). Here's the compiler output I get: > gxx -x c++ -O2 -c src/main.c++ -o objs/main.o > gxx -x c++ -O2 objs/main.o -o 2nybs.exe > objs/main.o:1: syntax error before character 01 > make.exe: *** [2nybs.exe] Error 1 That '-x c++' flag to the linkage run (the second) may be your problem. It tells gxx that all the filenames following it are C++ source files. I.e. it things objs/main.o is a c++ source file, which obviously it isn't. You shouldn't usually need the '-x c++' flag at all. Just be sure you use a standard filename convention for your source files. '.c++' is not an expected filename for C++ sources. It's not even a legal DOS filename, on top of that. Use '.cxx' or '.cpp' instead. Or '.cc' if you want to keep a bit closer to Unix conventions. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.