delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/03/19/17:31:51

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:mime-version:from:date:message-id:subject:to
:content-type; q=dns; s=default; b=KKEFtSmmicy/ix4O1jjztSgopxInz
XbNctJrX2+L2pmaE8QSdcT6UnIIWOe5TgLc3fFyddJXB388VXTHsrsjjx1CwTqea
tb86L2Ce0Vh2P0QrYnjuwf96AxrIWzH5DTwZQ1hgWvDwa/6MwSwCYCZTEG9M0OyE
4W7XOS50yZSxYs=
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:mime-version:from:date:message-id:subject:to
:content-type; s=default; bh=vlgH+SZoq5xIej5+QELCdh83k0w=; b=DJ6
bIpq0pm98ekUu4YZilVnibGgpsMGeIg+1mZYZmzNPm7kTg4nJif3rKSCqDqkLAGh
CnlEtV3Sr4m5u859bj6xKRU3RpRpFmacM4otdo9bBon4O4NVcGwrax8BP5KIaaYu
VjADj9UBr3deC7mXjCuOo11JwxUBqw6pSD9S+cEc=
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=-2.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,FROM_STARTS_WITH_NUMS,GIT_PATCH_2,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=Enterprise
X-HELO: mail-lf1-f42.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=JwuSuG4ZhqJ7cpfrm26wNt5zEKotMWyjvpbt/Wi03zE=; b=UwOAPRTiXhq/xJO9bzy88ficzGnQ4h64aiLg9OTurRkb1e7jd9myPdX9q07p+nrwmT kIDmxTE5vdt0HK0cc5AAO2v0vnB17ljjEjzIAl2CbA7za0XB2bNZBMizMT/OzTywbHwH mvl3cRQk9xGbfxW4KhCLV6QdFQ8CKU1hATG1lJWIDZkZQGBMULQnh8QTUuGTdP8hvmSG h23OTCCgMHT0B1LDLUSxcxkuU3AVkK3oT6TSAlNO22pHy9CptXYWsUYdZsho7YgbBq75 QQOxWYOafoeeMXY6k4U2GQBEt15z5tMmTJr0BnJUJIRJh0OvTy+fQzS8LDKYCvmDp9k/ cErQ==
MIME-Version: 1.0
From: "Vesa P." <938v14p33 AT gmail DOT com>
Date: Tue, 19 Mar 2019 23:31:12 +0200
Message-ID: <CAF0NPdi=FBVvQD4BNV9ThXcB1CoF31AZeKVKR27X4PeJq43U6w@mail.gmail.com>
Subject: Problems with "Hello, World!"
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

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.

Thanks for any help,
Vesa

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