C++编译之提示ld: can't open output file for writing: test1, errno=21 for architecture x86_64

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u011068702/article/details/83834496

1 问题

在mac 终端写了一个cpp文件,然后用命令编译运行提示错误如下

1111deMBP:code a1111$ g++ -std=c++11 test1.cpp -o test1
ld: can't open output file for writing: test1, errno=21 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

 

 

2 解决办法

应该是这个目录上有2个 test1.cp文件存在,只要修改这个文件名字编译就行

mv test1.cpp test123.cpp

猜你喜欢

转载自blog.csdn.net/u011068702/article/details/83834496