-   Linux - Newbie (
-   -   Compiling simple c program? (

meniscus 01-15-2007 04:25 AM

Compiling simple c program?
Hi, im doing this tutorial on yere forum here.

And when i try to complile im getting the following


meniscus@meniscot:~$ which gcc
meniscus@meniscot:~$ cd Desktop
meniscus@meniscot:~/Desktop$ gcc -o simpleq simpleq.c
simpleq.c:1:9: error: #include expects "FILENAME" or <FILENAME>
simpleq.c: In function ‘main’:
simpleq.c:5: warning: incompatible implicit declaration of built-in function ‘printf’

What is this about? Theres no "simpleq" executable?

Jaqui 01-15-2007 04:32 AM


simpleq.c:1:9: error: #include expects "FILENAME" or <FILENAME>
says you have an include statement typo in the file, that is why no executable, you got a fatal error in the first step of the compilation process.

try making the include:


#include <stdio.h>

The Headacher 01-15-2007 04:37 AM

There's an error in the example.

As the output from gcc tells you, there's a problem with line 1.

change it to

#include <stdio.h>
I'm not sure if this is a good tutorial/howto if the first example is wrong...

meniscus 01-15-2007 04:51 AM

thanks that works now.

All times are GMT -5. The time now is 07:30 PM.