Compiler error : /usr/lib/libc.so: file not recognized: File format not recognized
I am compiling a .c file with gcc & getting this
> gcc -o test.o test.c /usr/lib/libc.so: file not recognized: File format not recognized I tried it on bach as well as with csh. Getting the same error. > ls -l /usr/lib/libc.so lrwxrwxrwx 1 root root 19 Apr 7 2009 /usr/lib/libc.so -> ../../lib/libc.so.1 PS: I am on Solaris : Solaris 10 10/08 s10s_u6wos_07b SPARC |
Quote:
Code:
gcc -c -o test.o test.c Code:
gcc -o test test.c Quote:
Code:
file /usr/lib/libc.so |
Hi jlliagre
With gcc -c its working fine. Thanks a lot for your reply. However, now I am not able to link thread libraries with it. $ gcc -c -o test -c test.c -lthread gcc: -lthread: linker input file unused since linking not done. Can you suggest how can I proceed here. Thanks in advance. |
Remove the "-c" if you want to build an executable and please answer to my previous question (file /usr/lib/libc.so).
|
Hi,
$ file /usr/lib/libc.so /usr/lib/libc.so: ELF 32-bit MSB dynamic lib SPARC32PLUS Version 1, V8+ Required, dynamically linked, not stripped, no debugging information available After removing -c option I am getting previous error : File format not recognized |
Are you using the gcc bundled with Solaris or some other version you installed ?
|
Hi,
I am using $ gcc -v Reading specs from /usr/local/gnu/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2/specs gcc version 2.7.2 |
That's not the Solaris bundled one. You might want to try again with:
Code:
$ PATH=/usr/sfw/bin:$PATH |
All times are GMT -5. The time now is 09:59 PM. |