PDA

View Full Version : gcc and g++ weird compile error



opengl_cpp
January 16th, 2010, 06:05 PM
Hi guys.

I don't know why, but recently gcc/g++ always give me this error every time i try to compile something.

` C preprocessor "/lib/cpp" fails sanity check `

I checked /lib/cpp, I can't see /cpp directory under /lib, it seems to be removed.

I downloaded the whole gcc using apt-get but it didnt solve my problem.
if you have any suggestion, ill appreciate?s

denarced
January 16th, 2010, 10:49 PM
Hi guys.

I don't know why, but recently gcc/g++ always give me this error every time i try to compile something.

` C preprocessor "/lib/cpp" fails sanity check `

I checked /lib/cpp, I can't see /cpp directory under /lib, it seems to be removed.

I downloaded the whole gcc using apt-get but it didnt solve my problem.
if you have any suggestion, ill appreciate?s

the source code?
command you used?

deer dance
January 16th, 2010, 10:50 PM
It appears that part of the compiler has gone missing, perhaps reinstalling gcc will solve the problem?

eewoz
January 16th, 2010, 10:52 PM
Hi guys.

I don't know why, but recently gcc/g++ always give me this error every time i try to compile something.

` C preprocessor "/lib/cpp" fails sanity check `

I checked /lib/cpp, I can't see /cpp directory under /lib, it seems to be removed.

I downloaded the whole gcc using apt-get but it didnt solve my problem.
if you have any suggestion, ill appreciate?s

I don't know if this helps or not but on my installation in the /lib directory there is a shortcut called cpp that points to /etc/alternatives/cpp.

opengl_cpp
January 27th, 2010, 07:22 PM
thank you guys.
Maybe a explained my problem ambiguously. In fact I have no problem at compile time. But the problem is when i want to configure a source package. For example I download an application from sourceforge.com, when I issue ./configure it checks my system for dependencies, and riches to a point and warn me about my c headers, as i said at the top.

Maybe the problem comes from my libtools? i donno how to install that on my ubuntu????

daasdingo
January 27th, 2010, 07:42 PM
have you installed the

build-essential

package? you should at least have that one for compiling

opengl_cpp
January 27th, 2010, 11:57 PM
oh, i tried to install it before, and ubuntu said it was installed already. i mean i have this package. i searched the nest, but there was nothing useful.

i fear, if i have to reinstall the os.

i dont want to lose all of my data.

dwhitney67
January 28th, 2010, 01:28 AM
i dont want to lose all of my data.
You wouldn't if you were to create a separate partition for storing your data (including user accounts).

opengl_cpp
January 28th, 2010, 10:52 AM
unfortunately I have a single partition.
how can i fix this problem. Is it imposibble to shrink my partition and move my home dir to it, before reinstalling ubunut?