delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/05/17/03:39:45

Date: Thu, 17 May 2001 10:41:32 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "greg.pearce" <greg DOT pearce AT ntlworld DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: C++ problem
In-Reply-To: <000801c0de49$750c67a0$d16168d5@self>
Message-ID: <Pine.SUN.3.91.1010517104106.10813I-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 16 May 2001, greg.pearce wrote:

> int main()
> {
>     cout << "Hello world!, this is easy!";
>     return 0;
> }
> 
> i then saved it as cplus.cpp and then copyed and pasted it into the gpp =
> compiler
> it gave me the message:
> 
> c:/djgpp/bin/ld.exe:C:\DJGPP\BIN\CPLUS.~CP: file format not recognized; =
> treating
> as linker script
> c:/djgpp/bin/ld.exe:C:\DJGPP\BIN\CPLUS.~CP:1: parse error

The file's name is the problem: it has a weird ".~cp" extension,
instead of the normal ".cpp".  Section 8.5 of the FAQ explains how the
compiler deduces the file's format and language given its extension.

This weird name probably appeared because you ``pasted it into gpp''.
Whatever that means, don't do that: the DJGPP compiler is a
command-line program, it doesn't support well drag-and-drop and any
other communication methods you are used to on Windows, primarily
because Windows does all kinds of funky things when these methods are
used with DOS programs.  I'm quite sure the weird file name appeared
because Windows somehow mangled the file's original name when you
pasted it.

Simply invoke the compiler from the DOS box's prompt, by typing
"gpp cplus.cpp" etc.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019