Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have some strange problems regarding my build setup... acutally I am trying to compile

#include <stdio.h>

int main()
{
  printf( "Hello World!\n" );

  return 0;
}

By running

gcc -o simple simple.c 

But this gives some errors. First about cc1 not being found, after adding the path to $PATH I now get the error:

/usr/include/stdio.h:34:21: fatal error: stddef.h: No such file or directory

Long text, short question: How to delete all related stuff and reconfigure everything? I tried:

apt-get purge build-essential && apt-get install build-essential gcc g++

but this does not help/work!

Thank you for your help!

share|improve this question

1 Answer 1

build-essential is a meta package, so I'm not surprised that purging it has no effect.

Some options for rebuilding:

  1. apt-get install --reinstall gcc g++ Not guaranteed to succeed--if this doesn't help, try option 2
  2. apt-get purge gcc g++ && apt-get install gcc g++ This should succeed, but will likely take a large number of development packages with it. You can backup installed packages with the dpkg --get-selections trick
  3. (Nuclear option) Backup your installed package list with dpkg --get-selections and reinstall Ubuntu

Good luck!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.