delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/08/27/04:17:46

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Date: Sat, 27 Aug 2011 10:16:54 +0200
From: Jens Schweikhardt <schweikh AT schweikhardt DOT net>
To: cygwin AT cygwin DOT com
Subject: Re: Bash: Cannot execute binary file
Message-ID: <20110827081654.GA3281@schweikhardt.net>
References: <31263793 DOT post AT talk DOT nabble DOT com> <20110329013343 DOT GD12793 AT ednor DOT casa DOT cgf DOT cx> <31263838 DOT post AT talk DOT nabble DOT com> <20110329015306 DOT GE12793 AT ednor DOT casa DOT cgf DOT cx> <4D914393 DOT 5090409 AT cs DOT umass DOT edu> <0105D5C1E0353146B1B222348B0411A209E396A241 AT NIHMLBX02 DOT nih DOT gov> <loom DOT 20110827T073659-437 AT post DOT gmane DOT org>
MIME-Version: 1.0
In-Reply-To: <loom.20110827T073659-437@post.gmane.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

On Sat, Aug 27, 2011 at 05:50:06AM +0000, srinu wrote:
# Hi,
# 
# This problem is very frequently occuring irrespective of executable.
# A new laptop, windows7, downloaded the Cygwin with utmostcare in slecetingthe 
# desired and permissions.
# Wrote simple programe in c ( simple such that: print "hello world").
# while try to run the executable created throws the error: cannot execute 
# binary file.
# 
# flow is like follows:
# C file created: Hello.c ( full permissions)
# Compiled and linked: gcc -c Hello.c -o helloTest

You get what you asked for with -c, an object file. Instead use

    gcc Hello.c -o helloTest

which creates an executable.

Regards,

	Jens
-- 
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)

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

- Raw text -


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