![使用 g++ 编译 c++ 代码时无法识别的选项 --build-id](https://linux22.com/image/922724/%E4%BD%BF%E7%94%A8%20g%2B%2B%20%E7%BC%96%E8%AF%91%20c%2B%2B%20%E4%BB%A3%E7%A0%81%E6%97%B6%E6%97%A0%E6%B3%95%E8%AF%86%E5%88%AB%E7%9A%84%E9%80%89%E9%A1%B9%20--build-id.png)
嗯,我对 ubuntu 还不太熟悉。我尝试编译一个 c++ 代码。这是一个简单的 Hello world 代码。
我输入了以下命令
g++ temp.cpp
我收到以下错误信息:--
/usr/bin/ld: unrecognized option '--build-id'
/usr/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
我的 g++ 版本是:-
muleyashutosh@VAIO:~$ g++ --version
g++ (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
muleyashutosh@VAIO:~$ /usr/bin/ld --version
GNU ld (GNU Binutils for Ubuntu) 2.33
Copyright (C) 2019 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
我不明白这是什么意思,因为我只是一名工程专业的学生。我在谷歌上搜索了很多,但仍然无法解决这个问题。gcc 编译器的错误消息相同。希望你们能帮忙。我正在运行 Ubuntu 19.10。