这个问题是关于VS Code的CMake 工具扩展。操作系统为Windows 10。
该扩展正确地找到了 GCC,我可以通过查看%LocalAppData%/CMakeTools/cmake-tools-kits.json
.
{
"name": "GCC 10.3.0 x86_64-w64-mingw32",
"compilers": {
"C": "C:\\msys64\\mingw64\\bin\\x86_64-w64-mingw32-gcc.exe",
"CXX": "C:\\msys64\\mingw64\\bin\\x86_64-w64-mingw32-g++.exe"
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试通过相应的 VS Code 命令进行配置,但出现错误:
[rollbar] Unhandled exception: Unhandled Promise rejection: configure Error: No usable generator found. {}
Run Code Online (Sandbox Code Playgroud)
然后我将相应的设置添加到我的本地设置中.vscode/settings.json
。
[rollbar] Unhandled exception: Unhandled Promise rejection: configure Error: No usable generator found. {}
Run Code Online (Sandbox Code Playgroud)
我得到以下输出:
[proc] Executing command: "C:/Program Files/CMake/bin/cmake.exe" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_C_COMPILER:FILEPATH=C:\msys64\mingw64\bin\x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=C:\msys64\mingw64\bin\x86_64-w64-mingw32-g++.exe -H<path to project root> -B<path to build directory> -G "MSYS Makefiles" …
Run Code Online (Sandbox Code Playgroud) 非常简单的设置,请在家尝试一下。
$args
Run Code Online (Sandbox Code Playgroud)
$args
Run Code Online (Sandbox Code Playgroud)
@echo off
ruby test.rb "foo bar moo"
powershell .\test.ps1 "foo bar moo"
pause
Run Code Online (Sandbox Code Playgroud)
运行测试.bat。猜猜输出。
如果你像我一样想那你就错了。
["foo bar moo"]
foo
bar
moo
Run Code Online (Sandbox Code Playgroud)
Ruby 见证了这三个单词作为单个参数传递。PowerShell 以比尔·盖茨的名义在做什么?我怎样才能让它按逻辑工作?
或者我错过了什么?
我正在尝试使用<filesystem>
在 Windows 上运行的库获取程序。我正在使用 MSYS2(64 位)g++
。
#include <iostream>
#include <filesystem>
int main()
{
std::cout << "Hello World\n";
std::cout << "Current path is " << std::filesystem::current_path() << '\n';
}
Run Code Online (Sandbox Code Playgroud)
我正在构建它
g++ -std=c++17 -Wall -Werror -Wextra main.cpp -lstdc++fs
Run Code Online (Sandbox Code Playgroud)
我没有从编译器得到控制台输出。它默默地生成一个a.exe
. 执行a.exe
just 什么都不做。没有输出也没有错误。$?
(据说包含程序的返回码)是127
在运行程序之后。
g++ -v
印刷:
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-9.1.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++ --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string …
Run Code Online (Sandbox Code Playgroud)