如何解決編譯器編譯c++程式的問題?

如何解決編譯器編譯c++程式的問題?

每當我嘗試使用 編譯 C++ 程式時g++ hello.cpp,我都會得到:

The program 'g++' can be found in the following packages:
 * g++
 * pentium-builder
Try: sudo apt-get install <selected package>

然後如果我運行sudo apt-get install g++它輸出:

E: Unable to correct problems, you have held broken packages.

答案1

修復“持有損壞的包裹”錯誤:

sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get clean
sudo apt-get update

相關內容