简体   繁体   中英

How to change compiler on Clion from clang to gcc on MacOS?

The only compiler that works on my CLion is the clang one which is detected by default in toolchains. I need to use gcc (my college class grades using the gcc compiler so I want to avoid any unexpected issues) and have it installed through homebrew. In my terminal I can do g++ and gcc commands and it uses the right compiler, but I don't know how to change it in CLion. I must be doing something wrong with the location of it or the CMake settings. Any guidance would be appreciated and thank you. Let me know if there's any additional questions I can answer, my explanation may be insufficient as I am new to the world of CS. I see previous questions on how to switch compilers between gcc and clang, but not specifically on CLion.

The LANG part specifies the language (C for C and CXX for C++), and you need to provide the full path to the compiler

  • After you apply the settings, CLion will reset the CMake cache and reload your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM