Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-05-2009, 12:36 AM   #1
LQ Newbie
Registered: Jul 2009
Posts: 5

Rep: Reputation: 1
"Error: syntax before '@' token and Error: syntax at 'OTHER' token"


OK, so I know this is probably a very dumb question, but I am very new to programming, well computers in general... but I am catching on fairly quickly. I have run across these error messages and for the life of me can not figure out why I am getting them. I have not changed anything in my programming "style" or anything like that. I am using X-Code 3.0 and writing a very simple command tool following the iPhone Programming class from Stanford U. This is the error message and code I am getting from a custom class implementation.
NSString *descriptionString = [[NSString alloc] initWithFormat: @" Hello I am a %f sided polygon (aka a %@) with angles of %f degrees (%f radians).", (self.numberOfSides), (, (self.angleInDegrees), (self.angleInRadians)];

return descriptionString;

I know this is not at all a sophisticated program or something that should be worried about but I am trying to learn and have spent hours scratching my head at this... I get three error messages: "Error: syntax before '@' token" and "Error: syntax at 'OTHER' token"(this one I get twice). Any help would be appreciated very much, and I will keep trying to solve this mystery myself. Thank you!


Ok, well I fixed the problem. I do not know how but all I did was delete the method in both the header file and the implementation file and re-wrote it and it built fine with no errors or warnings.

Last edited by bullrider; 07-06-2009 at 08:59 PM. Reason: problem solved
Old 07-06-2009, 12:09 PM   #2
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,577
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Hello bullrider

Glad you found the solution.

A couple of tips to help you get faster and better responses by following "netiquette". Netiquette has evolved to communicate faster and better.

Now you have found the solution, please mark your thread solved by editing the first message and prefixing the title with [SOLVED].

It would have been helpful if you indicated the programming language in the original title and if you had given the program text in [CODE] tags so it formatted prettily. [CODE] tags are conveniently available via the # icon.


Old 07-27-2009, 09:00 AM   #3
Senior Member
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
I especially 2nd putting the language in the post title -- the programming forum encompasses too many languages to force us to guess which you are using. It's likely you'll get more people looking at your post also.

Please use the Thread Tools to add a "solved" tag to your title, please don't just edit "[SOLVED]" into the post body.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
sh: syntax error near unexpected token `(' venkatesh_b Linux - Newbie 1 05-16-2009 06:44 AM
syntax error near unexpected token `set' `if ( $dirhome == "." ) set dirhome = `pwd dayanand patil Linux - General 6 01-21-2009 02:52 AM
syntax error unexpected token near "then" pclimmex Linux - Newbie 1 06-20-2008 11:51 PM
/usr/include/stdio.h", line 346: syntax error at token '__s' casady Linux - Software 4 04-28-2006 01:51 AM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 07:09 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration