By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,728 Members | 1,112 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,728 IT Pros & Developers. It's quick & easy.

syntax error near unexpected token `('

P: 3
hi all

i am getting the error

line 11: syntax error near unexpected token `('
line 11: `int main()'


while trying to complie a c program in ubuntu
The code is very simple
# include <stdio.h>

int main()
{
printf("Hello");
return 0;
}

Please help me how to rectify this

Vani
Mar 24 '08 #1
Share this Question
Share on Google+
2 Replies

P: 14
The code you gave compiles fine on my system. How do you invoke the compiler? gcc <filename>?
Mar 29 '08 #2

kaarthikeyapreyan
100+
P: 107
hi all

i am getting the error

line 11: syntax error near unexpected token `('
line 11: `int main()'


while trying to complie a c program in ubuntu
The code is very simple
# include <stdio.h>

int main()
{
printf("Hello");
return 0;
}

Please help me how to rectify this

Vani
It works good for me too
Am using gcc 4.1.0
and the steps
test.c(your code)
Expand|Select|Wrap|Line Numbers
  1. gcc test.c -o test
  2. ./test
  3.  
and it print hello

I dont believe its your compiler's problem
Apr 1 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.