cannot compile gcc or g++ libc_nonshared.a not recognized

10,186

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
Share:
10,186

Related videos on Youtube

texasflood
Author by

texasflood

Updated on September 18, 2022

Comments

  • texasflood
    texasflood almost 2 years

    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;
    }