Fatal Error on Build: Permission Denied
已完成
Hello,
I've been using CLion for months without any problems, suddenly when I opened it today, whenever I try to build a new project, I get the following error:
fatal error: /usr/include/c++/7/bits/stl_vector.h: Permission denied
#include <bits/stl_vector.h>
I even tried reinstalling the whole CLion but with no success.
Any idea what to do is really welcome.
请先登录再写评论。
Hello!
On what OS do you run CLion? Have you tried restarting the machine?
Hello,
Yes of course, the restart is also performed when CLion is reinstalled.
I'm using Windows but I've set Toolchains to work through WSL.
The whole info provided by CLion whenever I try to build a project (even the one which used to work in the past):
====================[ Build | hw3 | Debug ]=====================================
/usr/bin/cmake --build /mnt/d/Dokumenty/MUNI/4_semestr/PB161_C++/hw3/cmake-build-debug --target hw3 -- -j 4
[ 33%] Building CXX object CMakeFiles/hw3.dir/number.cpp.o
[ 66%] Building CXX object CMakeFiles/hw3.dir/test.cpp.o
In file included from /mnt/d/Dokumenty/MUNI/4_semestr/PB161_C++/hw3/number.hpp:5:0,
from /mnt/d/Dokumenty/MUNI/4_semestr/PB161_C++/hw3/number.cpp:2:
/usr/include/c++/7/vector:64:10: fatal error: /usr/include/c++/7/bits/stl_vector.h: Permission denied
#include <bits/stl_vector.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /mnt/d/Dokumenty/MUNI/4_semestr/PB161_C++/hw3/number.hpp:5:0,
from /mnt/d/Dokumenty/MUNI/4_semestr/PB161_C++/hw3/test.cpp:4:
/usr/include/c++/7/vector:64:10: fatal error: /usr/include/c++/7/bits/stl_vector.h: Permission denied
#include <bits/stl_vector.h>
^~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/hw3.dir/build.make:62: recipe for target 'CMakeFiles/hw3.dir/number.cpp.o' failed
make[3]: *** [CMakeFiles/hw3.dir/number.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
CMakeFiles/hw3.dir/build.make:86: recipe for target 'CMakeFiles/hw3.dir/test.cpp.o' failed
make[3]: *** [CMakeFiles/hw3.dir/test.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/hw3.dir/all' failed
make[2]: *** [CMakeFiles/hw3.dir/all] Error 2
CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/hw3.dir/rule' failed
make[1]: *** [CMakeFiles/hw3.dir/rule] Error 2
Makefile:118: recipe for target 'hw3' failed
make: *** [hw3] Error 2
Never mind, I managed to solve the problem changing bits/stl_vector.h permission as they were all set to --- instead of read permission.
However, I still have no idea how it happened.
Thanks for sharing the information with us.