CMake Error at lib/cmake_install.cmake:48 (file): file INSTALL cannot copy file
“/home/yuan/cmake学习实践/t3/build/lib/libhello.so.1.2” to
“/usr/lib/libhello.so.1.2”.
错误:
[ 50%] Built target hello
[100%] Built target hello_static
Install the project...
-- Install configuration: ""
-- Installing: /usr/lib/libhello.so.1.2
CMake Error at lib/cmake_install.cmake:48 (file):
file INSTALL cannot copy file
"/home/yuan/cmake学习实践/t3/build/lib/libhello.so.1.2" to
"/usr/lib/libhello.so.1.2".
Call Stack (most recent call first):
cmake_install.cmake:37 (include)
Makefile:61: recipe for target 'install' failed
make: *** [install] Error 1
将命令
make install
改为
sudo make install
安装成功:
[ 50%] Built target hello
[100%] Built target hello_static
Install the project...
-- Install configuration: ""
-- Installing: /usr/lib/libhello.so.1.2
-- Installing: /usr/lib/libhello.so.1
-- Installing: /usr/lib/libhello.so
-- Installing: /usr/lib/libhello.a
-- Installing: /usr/include/hello/hello.h