Use clion rust debugging code on windows

Use clion rust debugging code on windows

clion on the windows can not msvc debugger toolchain, you need to debug using the gnu tool chain, how much describes the installation process tool chain does not search the next article, write it down the next record.

Specific steps of:

  1. Install mingw environment

    Installation msys2 (with mingw-64), download address https://www.msys2.org/ .

    Mingw open a terminal, install compilation tools:

     pacman -Syu
     pacman -S mingw-w64-x86_64-toolchain

    Suppose installed in c:\msys64the directory, then the system environment variables, add a:

     MSYS2_HOME  C:\msys64
     PATH        <原来的路径>;%MSYS2_HOME%\bin;%MSYS2_HOME%\mingw64\bin

    Other reference clion + msys2 relevant configuration articles.

  2. Installation rust gnu tool chain

    Use rustup installed on windows rust build environment uses the default compiler msvc chain, you need to install gnu compiler chain

     rustup install stable-gnu
     rustup default stable-gnu
  3. Set clion compiler tool chain

    In the clion File -> Settings -> Build, Execution, Deployment -> Toolchains, plus a chain mingw tool, set in the directory msys2 mingw64 directory. As msys2 installed c:\msys64, the directory c:\msys64\mingw64, the directory right circumstances, make, c-compiler, c ++ compiler, debugger , etc. automatically find.

After completing these settings, you can use the clion debugging rust.

Guess you like

Origin www.cnblogs.com/fengyc/p/11307295.html