Build and run project that use math.h in Clion [duplicate]
This question already has an answer here: How to link to the C math library with CMake? 1 answer How do I add flags like -lm (for math.h) in Clion to build and run a c file? I basically want to use pow() function from math.h in my code and run and debug the same in Clion. I'm new to CMake. This is my CMakeLists.txt: cmake_minimum_required(VERSION 3.5) project(Assign2) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES main.c) add_executable(Assign2 ${SOURCE_FILES}) NiñoScript You need to add target_link_libraries(YOUR_TARGET_NAME_HERE m) to your CMakeLists.txt file. (If you