Aatif Jamshaid Malik
Aatif Jamshaid Malik

Reputation: 71

Installing c++ standard library files on ubuntu

To give a background, there was a tuple file in /usr/include/c++ which got corrupted. So my compiler used to give input/output error. I downloaded tuple file from web from c++ library and replaced it with my corrupted file. But now error was different. My professor asked me to reinstall my library. So for that i removed /usr/include/c++ folder that had all library files. Now when i reinstalled g++ i thought it would automatically get the header files i.e /usr/include/c++ folder but i was wrong. It does not get installed. I have tried to find solution and people saying install -dev version etc but i could not find the commands to install those header files. Kindly help.

Upvotes: 5

Views: 28566

Answers (1)

BlueQuote
BlueQuote

Reputation: 128

Go to your command line and type the following:

sudo apt purge g++

and after that enter

sudo apt install g++

and finally type in

sudo apt-get install build-essential

After that you can try to get the headers back by getting libg++ with

sudo apt install libg++

if that doesn't help, you can also try these two commands.
First type:

dpkg --search /usr/include/c++

to get all the packages that have installed files to this directory.
After that you can reinstall all of these found packages with:

sudo apt-get install --reinstall

Upvotes: 5

Related Questions