Compiling a simple C program using gcc gives the error "could not read symbols" in RHEL6
Issue
- Compiling a simple C code using
gccthroughs the following error:
# cat hw.c
main(){
printf("Hello World");
}
# gcc hw.c
hw.c: In function main:
hw.c:2: warning: incompatible implicit declaration of built-in function printf
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
Environment
- Red Hat Enterprise Linux 6.x
- Arch x86_64
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
