LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   gcc on 9.1 include problem (https://www.linuxquestions.org/questions/slackware-14/gcc-on-9-1-include-problem-189738/)

skywarp 06-04-2004 02:36 PM

gcc on 9.1 include problem
 
I just installed Slackware 9.1 on my desktop machine, to do some development. I installed the entire development distribution set. After installing, I wrote a simple hello world program to test everything:

#include <stdio.h>

void main(void) {
printf("Hello World\n");
}

But when i do : gcc -o test test.c I get a screenful of parse errors from stdio.h all like this:

/usr/lib/gcc-lib/i486-slackware-linux/3.2.3/include/stdio.h:360 syntax error before "extern"

and about fifty more lines like it with slightly different syntax errors. Anybody know what I'm doing wrong or is there something I need to do to fix gcc?

187807 06-04-2004 09:06 PM

I compiled your program on my slackware (current) and it ran fine.

Just a thought but....

you said you installed all development stuff.

Did you grab all the library stuff too ("L" series?)

skywarp 06-04-2004 09:47 PM

Thank you very much 187807. That fixed my problem. I needed to install the libc package from the l/ distribution set. I'm not that familiar with how they do the packages, but I guess that makes sense.

coffeedrinker 06-04-2004 10:05 PM

The libraries have all the functions that you call within your programs. The packages have the header files .h as well as the .libs


All times are GMT -5. The time now is 01:39 PM.