I have syntax error when i execute littles programs (drag and drop) in C on fedora
David Gomez
tsukebumi at gmail.com
Thu Apr 7 11:59:54 UTC 2005
On Thu, 2005-04-07 at 10:15 +0200, bastidesamuel at neuf.fr wrote:
> I want to write littles programs in c on fedora
> I have done
> vi prog
> then
> chmod 755 prog
>
> then i have drag and drop on "vi" some program of wiki dictionnary to
> test that it work
>
> #include <stdio.h>
> #include "math.h"
>
> int main(void)
> {
> printf("%d\n",add(3,5));
> }
>
> but when I do ./prog
> it return to me
> ./popo: line 4: syntax error near unexpected token `('
> ./popo: line 4: `int main(void)'
>
Are you starting to learn how to program?
you have to compile a C program before you can execute it.
this will do for this time
gcc ./prog -o my_prog
Now, that compiled your program prog (you should rename it to prog.c)
and get an output file my_prog that you can execute
./my_prog
More information about the fedora-list
mailing list