且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Visual Studio代码:使用文件系统库

更新时间:2023-11-29 13:59:28

感谢大家的投入.我已经解决了这个问题,尽管没有任何实际的解决方案.MinGW是我最大的嫌疑人,因为:

thank you all for your input. I'm done with this problem, although without any actual solution. MinGW is my biggest suspect, since:

  1. 我能够在Linux上通过ssh进行编译,我的GCC版本为 g ++(GCC)8.3.1 20190311(Red Hat 8.3.1-3)-实际上,这是我的目标,因此我不需要它在Windows上进行编译,并且
  2. 如果我必须针对Windows进行编译,则可以通过Visual Studio 2019来完成,据我所知,Visual Studio 2019默认情况下不使用MinGW.
  1. I am able to compile through ssh on Linux, where my version of GCC is g++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3) - this is actually my target, so I don't need it to compile it on Windows, and,
  2. if I have to compile for Windows, I can do it through Visual Studio 2019, which as far as I know, doesn't use MinGW by default.

无法编译的我的GCC版本是 g ++.exe(x86_64-posix-seh-rev0,由MinGW-W64项目构建)8.1.0

My GCC version, where the compilation doesn't work, is g++.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0

另外,在Linux上,当我输入如下命令时,它也可以工作:

Also, on Linux, it works when I type the command like this:

g++ main.cpp -std=c++17 -lstdc++fs -o main