LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Compiling simple c program? (http://www.linuxquestions.org/questions/linux-newbie-8/compiling-simple-c-program-519399/)

meniscus 01-15-2007 04:25 AM

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

http://www.linuxquestions.org/linux/...grams_on_Linux


And when i try to complile im getting the following

Code:

meniscus@meniscot:~$ which gcc
/usr/bin/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

Quote:

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:

Quote:

#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
Code:

#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 10:47 PM.