delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/03/19/23:33:36

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:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=yuI9k5ocTpp8CGkF
JnawRr9z+PA5rk0RsYKLwYBZMajGNR8t3JoziBf4M0/s5u/HFyt57OJ5urFc7e1/
MyfeOvy/a/348oFaDRNqKB8+dWn6OhPhdS4YB1v/g96V2cJVJemF6N8WS18Y1kgM
0fCgapfbIU9EUFKhaZam7xeQ5V0=
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:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=LutkNWBpR7OtzdTt7ALnm2
9h0po=; b=fP39QEkstPEuSQE1ub27tIfrFhn+0p5tavZfQ7zTPm43H44OHRVbqX
Td3Tn/N1ERYDgWF9F0s3yxZP7u7B9Wx1xbDAtUxfv8M2BvCqEiJkIVjsTOZx799n
YhsWyXl7We2I564MkyctRViWf0y2eyTa4quaFHc7cRdw94xmRQyUQ=
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=-4.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=UD:problems.html, problemshtml, problems.html, HX-Languages-Length:1983
X-HELO: smtp-out-no.shaw.ca
Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca
Subject: Re: Problems with "Hello, World!"
To: cygwin AT cygwin DOT com
References: <CAF0NPdi=FBVvQD4BNV9ThXcB1CoF31AZeKVKR27X4PeJq43U6w AT mail DOT gmail DOT com>
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Openpgp: preference=signencrypt
Message-ID: <7d551593-3481-6207-880d-7bf567081ff8@SystematicSw.ab.ca>
Date: Tue, 19 Mar 2019 21:33:21 -0600
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0
MIME-Version: 1.0
In-Reply-To: <CAF0NPdi=FBVvQD4BNV9ThXcB1CoF31AZeKVKR27X4PeJq43U6w@mail.gmail.com>
X-IsSubscribed: yes

On 2019-03-19 15:31, Vesa P. wrote:
> 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.
> 
> I did those experiments in a Windows 10 environment, I think it is
> Windows 10 Enterprise. I have installed Cygwin without administrator
> privileges, in 2018.
> 
> A practical work-around has been to use MinGW for compilation.

Rather than describing what you did, copy and paste a shell transcript showing
the commands and output from you listing the source code, compiling and running
it, a long listing of the directory contents, then run

	"cygcheck -hrsv > cygcheck.out"

and attach the output as a text file to a post to this list, as explained below
under Problem reports: http://cygwin.com/problems.html.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

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