【发布时间】:2012-09-30 09:25:37
【问题描述】:
每次我尝试在 ubuntu 中使用 g++ 编译时都会出现以下错误
g++ test.cpp -o test
/usr/bin/ld: 1: /usr/bin/ld: /bin: Permission denied
/usr/bin/ld: 2: /usr/bin/ld: test.cpp: not found
/usr/bin/ld: 3: /usr/bin/ld: test.cpp: not found
/usr/bin/ld: 4: /usr/bin/ld: test.cpp: not found
/usr/bin/ld: 5: /usr/bin/ld: test.cpp: not found
/usr/bin/ld: 6: /usr/bin/ld: test.cpp: not found
/usr/bin/ld: 7: /usr/bin/ld: test.cpp: not found
/usr/bin/ld: 8: /usr/bin/ld: test.cpp: not found
/usr/bin/ld: 9: /usr/bin/ld: test.cpp: not found
/usr/bin/ld: 10: /usr/bin/ld: test.cpp: not found
/usr/bin/ld: 11: /usr/bin/ld: test.cpp: not found
/usr/bin/ld: 12: /usr/bin/ld: Syntax error: "(" unexpected
我已经多次删除并重新安装了 g++。 /usr/bin 和 /usr/bin/ld 的 chmod 是 755,奇怪的是我可以运行它 g++ -c test.cpp 但是我不能运行 .o 文件。我不完全确定是什么问题。
【问题讨论】:
标签: c++ gcc ubuntu permissions g++