How to run C language code on JetBrains CLion

17,237

Solution 1

To elaborate on the answer provided by "uta" you need either MinGW or Cygwin in order to compile your code. MinGW can be obtained from here: MinGW

Or Cygwin from here: Cygwin

For simplicity I will describe MinGW. Install MinGW then navigate like so in CLion:

File -> Settings -> Build, Execution, Deployment -> Toolchains

And select the directory you have MinGW installed. I believe by default on Windows it's C:\MinGW. Once you've done this CLion will scan the directory and detect it.

If you already have them installed then you need only select the folders they're installed in in CLion.

Hope this helps.

Solution 2

Please, start from menu: File | Settings... | Build, Execution,... | Toolchains | Environment:

Share:
17,237
Ramin Farajpour Cami
Author by

Ramin Farajpour Cami

Updated on June 12, 2022

Comments

  • Ramin Farajpour Cami
    Ramin Farajpour Cami about 2 years

    I get the following error :

    Error:Neither MinGW nor Cygwin is selected

    Do you have idea for resolve this issue?

  • Sergei Krivonos
    Sergei Krivonos over 7 years
    How about MSVC? Isn't supported?
  • uta
    uta over 7 years
    Sorry, but currently CLion is not working with MS compiler. Mostly because MS compiler is not providing preprocessor info extraction. intellij-support.jetbrains.com/hc/en-us/articles/…
  • Razakhel
    Razakhel about 7 years
    CLion now supports MSVC with its last version: blog.jetbrains.com/clion/2017/03/clion-2017-1-released/#msvc‌​. It is currently marked as unstable and debugger isn't supported, but it seems to work fine.