delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/07/12:17:57

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: "Dave Korn" <dk AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: file not recognized:File format not recognized
Date: Mon, 7 Jun 2004 17:17:12 +0100
MIME-Version: 1.0
In-Reply-To: <Pine.GSO.4.58.0406041155150.2262@slinky.cs.nyu.edu>
Message-ID: <NUTMEG3G5aYY61LEdyt00000200@NUTMEG.CAM.ARTIMI.COM>
X-OriginalArrivalTime: 07 Jun 2004 16:17:12.0562 (UTC) FILETIME=[E3F17520:01C44CAA]

> -----Original Message-----
> From: cygwin-owner On Behalf Of Igor Pechtchanski
> Sent: 04 June 2004 16:59

> On Fri, 4 Jun 2004, c dana wrote:
> 
> > I am a novice at cygwin.
> > I edited a file "test.c" with notepad in windows.
> > Then I compiled it with gcc in cygwin by typing:
> > $ gcc test.c
> > However I got the following error message:
> >
> > test.c: file not recognized:File format not recognized
> > collect2: ld return 1 exit status.
> >
> > My OS is WinXp. Could anyone tell me what's wrong?
> > Dana

> It would have also helped if you actually attached the 
> problem file.  One
> WAG is that notepad tends to append a ".txt" suffix to the provided
> filename, and if you had an older file called "test.c", you may not
> actually be compiling the file you're expecting to compile.

  Notice how the error message comes from collect2.  That means gcc is
attempting to link that .c file as if it were a .o file.  Something is
terribly wrong here, gcc should have deduced the file type as source not
object from the .c extension.

  Therefore I think Dana has not reported the exact command line that was in
use, but has re-typed it rather than cut-and-pasted it and omitted some
vital details.

  Dana, try doing "gcc -v test.c" instead, and cut and paste the output into
a reply... that should give us more information about which file is actually
being compiled and what the compiler thinks it's trying to do.


    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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