Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CLion: Enable compiler errors/warnings

Tags:

cmake

clion

I am using CLion 2016.1.1 on Ubuntu (16.04)

When I compile my project, the CMake output shows:

/opt/clion/bin/cmake/bin/cmake --build 
/home/glapworth/.CLion2016.1/system/cmake/generated/project_name-f43e0982/f43e0982/Debug --target all -- -j 8
[ 33%] Linking C executable 
/home/glapworth/src/project/project_name/bin/project_name

However, when I execute:

/opt/clion/bin/cmake/bin/cmake --build /home/glapworth/.CLion2016.1/system/cmake/generated/project_name-f43e0982/f43e0982/Debug --target all -- -j 8

I can see the compiler error:

...
CMakeFiles/project.dir/src/main.c.o: In function `main':
/home/glapworth/src/project/project_name/src/main.c:22: undefined reference to `curl_global_init'
...

How can I get CLion to show the compiler errors or warnings?

like image 528
glapworth Avatar asked Apr 20 '16 15:04

glapworth


People also ask

How do I turn off clang tidy in CLion?

To suppress a Clang-Tidy check for a particular line, use the Suppress "check_name" for line option. CLion will add a // NOLINT comment at the end of the selected line.


1 Answers

here's bug-report https://youtrack.jetbrains.com/issue/CPP-6559

No, CLion shows all compile errors. You can't compile a project if you have errors.

But, CLion shows notices only once during build time, until you make a clean build, you will not see them again. Because you have already compiled object files and CLion (CMake) will not rebuild them if you haven't changed source files.

CMake assumes you know what your'e doing and does not rebuild all your codebase from scratch, so you don't see notices after the first compile run.

like image 76
strangeqargo Avatar answered Oct 03 '22 20:10

strangeqargo