简体   繁体   中英

Bus error while compiling with gcc

I can't seem to be able to compile even simple C programs anymore; I can't seem to be able to pinpoint what changed from yesterday, when all seemed to be fine.

I'm using gcc 5.2.1 .

Compiling this program (or any other program)

#include <stdio.h>

int main(int argc, char *argv[]) {
    printf("Hello world!\n");

    return 0;
}

gives me this error:

<built-in>: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.

I'm at loss; what I found while searching on the internet are posts from a few years back detailing bugs that have been solved, or bus error generated from a C program for incorrect use of memory.

I've tried purging and reinstalling gcc with apt-get (I'm using Ubuntu), but nothing changed.

我会检查内存,文件系统和磁盘表面,也可能进行其他硬件检查。

I was having issues with my wireless, too; I have no idea how or why, but after entering the command

sudo apt-get install --reinstall bcmwl-kernel-source

and rebooting, gcc started working again. I'm confident that this did the trick, as I tried compiling just before issuing the command.

While I'd still like to understand why that happened, I guess this fixed the problem.

I have the same problem I could not install mysqldb and my GCC was giving error like that:

在此输入图像描述

I fixed the problem in Ubuntu by updater and the Ubuntu partial version

The problem arises because of partial installation of other packages.

Steps:

1) got to updater
2) find there to update and restart Ubuntu

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM