Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GCC compilation problem with a very simple program!!!

Status
Not open for further replies.

celia05es

Programmer
Jan 10, 2002
81
US
Hello,

The gcc compiler has been installed on a Sun machine, the version is 3.2.1.
When I try to compile the simplest possible program "hello.c", I get the following errors..... please help me !!! I don't know what to do and I am really stuck!!!
Thanks

# pg hello.c
#include <stdio.h>

main()
{
printf(&quot;\n&quot;);
printf(&quot;**************\n&quot;);
printf(&quot;*Hola a todos*\n&quot;);
printf(&quot;**************\n\n&quot;);
}


# gcc hello.c
In file included from hello.c:1:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/stdio.h:36:27: iso/stdio_iso.h: No such file or di
In file included from hello.c:1:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/stdio.h:194: parse error before '*' token
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/stdio.h:229: parse error before '*' token
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/stdio.h:230: parse error before '*' token
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/stdio.h:236: parse error before &quot;size_t&quot;
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/stdio.h:241: parse error before &quot;size_t&quot;
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/stdio.h:250: parse error before '*' token
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/stdio.h:252: parse error before '*' token
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/stdio.h:276: parse error before '*' token
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/stdio.h:285: parse error before '*' token
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/stdio.h:286: parse error before &quot;FILE&quot;
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/stdio.h:287: parse error before '*' token

# gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/specs
Configured with: ../configure --disable-nls --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld
Thread model: posix
gcc version 3.2.1
 
It would appear that the file /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include/iso/stdio_iso.h is missing.

Perhaps its in a different location (perhaps /usr/include/iso)

Check to see if you have an iso subdirectory and what is in it. How did you install gcc, from a package or from the source.

If it was installed from a package you should be able to see where the file was put by examining /var/sadm/install/contents and grepping for the word stdio_iso.h

Cheers
 
THanks for your answer..... Actually I had the gcc re-installed.... and it works!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top