在 Clion 中调试 Rust 结果 "Error creating process"
Debugging Rust in Clion results in "Error creating process"
我是 Rust 的新手,想使用 Clion (19.3 currently) and followed 将编译器从 MSVC 切换到 GNU 来调试我的 Rust 代码,现在当我 运行 我的程序(调试中)时,我得到来自 Clion 的错误:
com.jetbrains.cidr.execution.debugger.backend.gdb.GDBDriver$GDBCommandException: Error creating process <Program Path>, (error 50).
虽然 运行宁没有调试工作正常。
如果我 google 我得到这个错误 issue on github 基本上说在 64 位应用程序上使用 64 位编译器。我添加的编译器是 64 位的,因为我安装了 64 位版本的 rust,我假设它输出的程序是 64 位的...(尽管我对 rust 的了解还不够 100% 确定)
运行 rustup show
returns 这个:
rustup show
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\User\.rustup
installed toolchains
--------------------
stable-x86_64-pc-windows-gnu (default)
stable-x86_64-pc-windows-msvc
active toolchain
----------------
stable-x86_64-pc-windows-gnu (default)
rustc 1.42.0 (b8cedc004 2020-03-09)
这就是我认为正在使用正确的工具链的地方(正如它所说的 x86_64
到处都是)。
我哪里出错了?什么是未配置的?
事实证明我超级笨,让 Clion 指向 32 位安装而不是 64 位安装。我最终遵循了 Jetbrains 自己的指南:https://blog.jetbrains.com/clion/2019/10/debugging-rust-code-in-clion/
On Windows, go to Settings | Build, Execution, Deployment | Toolchain and set either Cygwin or MinGW as your working environment. Then, run rustup toolchain list and check the first line: it should be one of the gnu versions matching the bitness of the debugger. For example, if you’re working on MinGW (32-bit), the default toolchain should be i686-pc-windows-gnu. If you’re on MinGW64, it should be x86_64-pc-windows-gnu. You can set the appropriate toolchain by running rustup default "toolchain_name".
2021 年 10 月更新
Jetbrains 发布了更新的博客 post,其中显示了他们对调试过程所做的一些改进,例如 windows 您不再需要更改设置即可进行调试! https://blog.jetbrains.com/rust/2021/10/19/debugging-rust-in-jetbrains-ides-state-of-affairs/
我是 Rust 的新手,想使用 Clion (19.3 currently) and followed
com.jetbrains.cidr.execution.debugger.backend.gdb.GDBDriver$GDBCommandException: Error creating process <Program Path>, (error 50).
虽然 运行宁没有调试工作正常。
如果我 google 我得到这个错误 issue on github 基本上说在 64 位应用程序上使用 64 位编译器。我添加的编译器是 64 位的,因为我安装了 64 位版本的 rust,我假设它输出的程序是 64 位的...(尽管我对 rust 的了解还不够 100% 确定)
运行 rustup show
returns 这个:
rustup show
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\User\.rustup
installed toolchains
--------------------
stable-x86_64-pc-windows-gnu (default)
stable-x86_64-pc-windows-msvc
active toolchain
----------------
stable-x86_64-pc-windows-gnu (default)
rustc 1.42.0 (b8cedc004 2020-03-09)
这就是我认为正在使用正确的工具链的地方(正如它所说的 x86_64
到处都是)。
我哪里出错了?什么是未配置的?
事实证明我超级笨,让 Clion 指向 32 位安装而不是 64 位安装。我最终遵循了 Jetbrains 自己的指南:https://blog.jetbrains.com/clion/2019/10/debugging-rust-code-in-clion/
On Windows, go to Settings | Build, Execution, Deployment | Toolchain and set either Cygwin or MinGW as your working environment. Then, run rustup toolchain list and check the first line: it should be one of the gnu versions matching the bitness of the debugger. For example, if you’re working on MinGW (32-bit), the default toolchain should be i686-pc-windows-gnu. If you’re on MinGW64, it should be x86_64-pc-windows-gnu. You can set the appropriate toolchain by running rustup default "toolchain_name".
2021 年 10 月更新
Jetbrains 发布了更新的博客 post,其中显示了他们对调试过程所做的一些改进,例如 windows 您不再需要更改设置即可进行调试! https://blog.jetbrains.com/rust/2021/10/19/debugging-rust-in-jetbrains-ides-state-of-affairs/