public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Csaba Raduly <rcsaba@gmail.com>
To: cygwin list <cygwin@cygwin.com>
Subject: Re: Programs using std::filesystem with gcc 9.2.0 fail to run
Date: Sat, 08 Feb 2020 13:46:00 -0000	[thread overview]
Message-ID: <CAEhDDbC1U-UOEMSNznjhPyKdHBhBtDuFK1PKGmyS4ALrRtFuPA@mail.gmail.com> (raw)
In-Reply-To: <MTAwMDAzNi5iaWxs.1581124920@quikprotect>

On Sat, Feb 8, 2020 at 2:22 AM <velix@bill.router5.com> wrote:

> It's possible to compile and link programs that use std::filesystem with
> the g++ 9.2.0 compiler for Cygwin.  For instance if I place the following
> program into a file name "x.cpp":
>
>     #include <iostream>
>     #include <filesystem>
>
>     int main()
>     {
>         std::filesystem::path p{"/tmp"};
>         std::cout << p << std::endl;
>     }
>
> Then compile with:
>
>     g++ -std=c++2a -Wall -O3 x.cpp
>
> It builds successfully.  But running the output "a.exe" file exits
> immediately with exit code 127.  It does not help if I also add
> "-lstdc++fs" to the build command.
>

Works just fine wih me:

$ g++ -std=c++2a -Wall -O3 fsys.cpp
$ ./a.exe
"/tmp"

Try running yours under gdb. You may get some more useful information about
the error.
Csaba
-- 
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformant
way
to get the wrong information: this is what you want. - Scott Meyers
(C++TDaWYK)

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

      reply	other threads:[~2020-02-08 13:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-08  1:22 velix
2020-02-08 13:46 ` Csaba Raduly [this message]

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=CAEhDDbC1U-UOEMSNznjhPyKdHBhBtDuFK1PKGmyS4ALrRtFuPA@mail.gmail.com \
    --to=rcsaba@gmail.com \
    --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).