Search code examples
cdefaultclion

Set C11 as default Language in Clion


I'm studying C at the university and I just downloaded Clion; How can I change the default language so that every project I create will be ready to work?


Solution

  • Depending on the version of Clion you will either see the CMakeLists.txt contain something like

    set(CMAKE_CXX_FLAGS "-std=c++11")
    

    or for recent EAP builds

    set(CMAKE_CXX_STANDARD 11)
    

    Simply change the variables and flags to the correct ones for C.

    There's currently no way (that I know of) to make it use C language as default for new projects. You must manually edit the project CMakeLists.txt file.


    With recent versions of CLion you can now create C projects as well, making this answer somewhat obsolete.