public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Problems with "Hello, World!"
Date: Wed, 20 Mar 2019 03:33:00 -0000	[thread overview]
Message-ID: <7d551593-3481-6207-880d-7bf567081ff8@SystematicSw.ab.ca> (raw)
In-Reply-To: <CAF0NPdi=FBVvQD4BNV9ThXcB1CoF31AZeKVKR27X4PeJq43U6w@mail.gmail.com>

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

  parent reply	other threads:[~2019-03-20  3:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 21:31 Vesa P.
2019-03-19 22:14 ` Thomas Wolff
2019-03-20  3:15 ` L A Walsh
2019-03-20  3:33 ` Brian Inglis [this message]
2019-03-22 14:25   ` Vesa P.
2019-03-22 18:58     ` Achim Gratz
2019-03-23  8:17     ` Houder
2019-03-23  8:33       ` Houder
2019-03-23  8:52         ` Houder
2019-03-25 13:35         ` Vesa P.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7d551593-3481-6207-880d-7bf567081ff8@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).