2

I cannot compile C/C++ files anymore since using a new account (I think it was since then anyway) and I'm getting a strange error every time I try to compile:

~$ g++ hello.cpp
/usr/lib/x86_64-linux-gnu/libc_nonshared.a: file not recognized: File format not recognized
collect2: ld returned 1 exit status

It happens with both gcc and g++ and I cannot find any help on this anywhere. I am using Ubuntu 12.04

hello.cpp

#include <iostream>
#include <stdio.h>

using namespace std;

int main() {
  cout << "Hello" << endl;
  return 0;
}
0

1 Answer 1

3

It seems you have corrupted /usr/lib/x86_64-linux-gnu/libc_nonshared.a file, try reinstall libc development files:

sudo apt-get --reinstall install libc6-dev
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .