Ask Your Question

trouble compiling with gcc 5.1.1 in fedora-22

asked 2015-08-19 17:45:31 -0500

XAOC gravatar image

updated 2015-08-19 18:51:39 -0500

Hello, I have what I would call a dumb issue but it seems I won't figure it out by myself... So here I am.

I am trying to compile a basic "hello world!" code:

#include <stdio.h>
int main() {
   printf("Hello World!\n");
   return 0;

I compile with this command:

gcc -Wall hello.c -o test

and I am getting this error:

gcc: error trying to exec '/usr/libexec/gcc/x86_64-redhat-linux/5.1.1/cc1': execv: Exec format error

I tried to remove and reinstall gcc several times using the dnf commands, but I am still getting the same results.

sudo dnf remove gcc
sudo dnf install gcc

I am running a fresh dual boot install of Fedora-22 and I made sure to use "sudo dnf update" before trying to compile anything.

Also, I tried:

file /usr/libexec/gcc/x86_64-redhat-linux/5.1.1/cc1

Which gives:

/usr/libexec/gcc/x86_64-redhat-linux/5.1.1/cc1: empty

Hence, I believe there is something wrong with my gcc install.

Any ideas about what to try next? What am I not seeing here?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-08-23 16:45:09 -0500

XAOC gravatar image

It seems like my problem is solved. Reinstalling gcc wasn't doing the trick for my problem so I decided to downgrade gcc using:

sudo dnf downgrade gcc --allowerasing

I had gcc-5.1.1-4 installed and I downgraded to gcc-5.1.1-1. The latter is now compiling fine.

edit flag offensive delete link more

Question Tools


Asked: 2015-08-19 17:45:31 -0500

Seen: 770 times

Last updated: Aug 23 '15