Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!mcsun!unido!unidui!veit From: veit@du9ds3.uni-duisburg.de (Holger Veit) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: DOS gcc (dj1bin) problems, malformed input file error Message-ID: Date: 1 Mar 91 14:58:40 GMT References: <61762@masscomp.westford.ccur.com> <7594@uklirb.informatik.uni-kl.de> Sender: @unidui.uni-duisburg.de Organization: Rechenzentrum Uni-Duisburg Lines: 40 In <7594@uklirb.informatik.uni-kl.de> kirchner@informatik.uni-kl.de (Reinhard Kirchner) writes: >From article <61762@masscomp.westford.ccur.com>, by bobg@masscomp.westford.ccur.com (Bob Getz): >> >> Hello, netlanders; >> >> I recently got the GNU C++ for DOS via ftp from grape..... >> >> I tried to compile a very simple test program and got the following: >> >> e:\gcc test.cpp >> ld: malformed input file (not rel or archive) test.cpp >> e:\> >> >A friend of mine tried the gcc and he told me: >Source files MUST NOT HAVE Control-Z at their end. >This maz be the reason for the error above. >This is a real foolish problem in such a tremendous package. Control-Z >is standard from many editors, the authors should have checked this. >Reinhard Kirchner >Univ. Kaiserslautern, Germany >kirchner@uklirb.informatik.uni-kl.de No! This is not the reason. Same thing happens if you try this on a UNIX machine (at least SUN3 & 4). The real reason is: GCC.EXE is the compiler driver and it decides what to do from the source file extension. If the extension is .c, this is a C-source file as usual; a .o or .a are objects and libraries, .i is preprocessor output and .s is assembler input. Unfortunately, .cpp is not as intended a C-Plus-Plus file - - - and so the C-driver passes this immediately to the linker. Try the extension .cc (this is the c++ extension). Holger Veit -- | | / Holger Veit | INTERNET: veit@du9ds3.uni-duisburg.de |__| / University of Duisburg | BITNET: veit%du9ds3.uni-duisburg.de@UNIDO | | / Fac. of Electr. Eng. | UUCP: ...!uunet!unido!unidui!hl351ge | |/ Dept. f. Dataprocessing |