How to create a C project with CLion

If you create a new project on CLion, it will be a C++ project.
If you want a C project, for the moment (2 years ago that users are asking the same to JetBrains here) you will need to edit CMakeLists.txt file:

replace:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)

by:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
set(SOURCE_FILES main.c)

Now, rename your main.cpp to main.c

Enjoy it!

Remember CLion (Jetbrains suite) it's free for students

Comments

Popular posts from this blog

from: can't read /var/mail/ in Python scripts

How to fix Android when developer options are not available for this user

How to install a WhatsApp bot based on Python