delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/03/19/18:15:01

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=SpIGKyzrzR0jmpl3
CzRASrmHolMtKUEh1QV1kXGDo3TONb/L9bpOKjz6DrBBPUuvMngyqduYsqHFTn7w
kq3hfXCr8BriPaKBLtLmpUUonah/E6haWr0ZYoz0zLvRD5xACyNfHwqluh0EghE2
Lt5w+dw19Od38ZskfjFzLNroc8Y=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=B64Tb+b+N5NJfF4t5V2DNj
or9WM=; b=EX3OxPJ9aYL8RW+wXjOGcEUqsUGcCTLww0tKYqInjen74IBw6nGQrl
g3JIs+Yecsa9Miz7LeXhy7qbTvey++mDq3fwfH8IXVquNUL+tTw5MWTXbM21BGlv
1fd9coO9GG/phJsnmTAEo6FlioncTYna7cLo4hvnFAeZYdHuxoHbM=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-6.1 required=5.0 tests=BAYES_00,GIT_PATCH_2,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1220
X-HELO: mout.kundenserver.de
Subject: Re: Problems with "Hello, World!"
To: cygwin AT cygwin DOT com
References: <CAF0NPdi=FBVvQD4BNV9ThXcB1CoF31AZeKVKR27X4PeJq43U6w AT mail DOT gmail DOT com>
From: Thomas Wolff <towo AT towo DOT net>
Message-ID: <c864454d-679b-31cf-3c65-e13b5463c24b@towo.net>
Date: Tue, 19 Mar 2019 23:14:46 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3
MIME-Version: 1.0
In-Reply-To: <CAF0NPdi=FBVvQD4BNV9ThXcB1CoF31AZeKVKR27X4PeJq43U6w@mail.gmail.com>
X-IsSubscribed: yes

Am 19.03.2019 um 22:31 schrieb Vesa P.:
> Hi all,
>
> Cygwin works great for me in providing POSIX tools for Windows, but
> when I tried to to compile something of my own, I immediately ran into
> problems.
>
> Compiling my Hello World application didn't complain but when running
> it I didn't get any output. My compilation command was like this:
>     gcc -Wextra -Wall -o hello hello.c
> And my source code is below between "---" markers:
> ----------------------------------
> #include <stdio.h>
>
> int main() {
>    printf("Hello, World!\n");
>    return 0;
> }
> ----------------------------------
> I also tried by redirecting output, like "./hello > output.txt" but
> that created only an empty file, proving that my write permissions
> were sufficient, I suppose.
> Then I thought that maybe the problem is in connecting to stdout and I
> tried by direct file access:
> ---------------------------------
> #include <stdio.h>
>
> int main() {
>    FILE *of = fopen("./outfile.txt", "w");
>    if(of) {
>      fprintf(of, "Hello, World!\n");
>      fclose(of);
>    }
>    return 0;
> }
> ---------------------------------
> However, that didn't create the "outfile.txt" file.
What does `type gcc` tell you?

--
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