New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

XCode (Help with error messages) First - Using the word "new" as a variable


Post Reply New Thread Subscribe

 
Thread Tools
nickypaul
Guest
 
Posts: n/a

I am having problems compiling some code in Xcode 1.5 and was hoping somebody might help. I guess I'll start with my first problem and then ask about the other one later.

I'm trying to compile someone else's code and uses the word "new" as a variable and keeps coming up as an error. Problem is, the source code is huge and it's really not practical to change the name.

Is there any way to have Xcode ignore this type of error?

Thanks

Code example:
short new;

Error Message:
error: parse error before `new'
QUOTE Thanks
Prometheus
Guest
 
Posts: n/a

On the lines before there isn't a ; missing after another variable is declared is there?
QUOTE Thanks
mynameis

 
Member Since: Sep 30, 2004
Posts: 3,378
mynameis is just really nicemynameis is just really nicemynameis is just really nicemynameis is just really nice

mynameis is offline
Are you using Objective-C or Java? I know 'new' is a reserved word in Java, I would assume similar for Objective-C.
QUOTE Thanks
Macman

 
Macman's Avatar
 
Member Since: Oct 30, 2004
Location: San Antonio, Texas
Posts: 4,374
Macman has a spectacular aura about
Mac Specs: PowerMac G4 Cube 450mhz 832mb

Macman is offline
I thought that variable would be in quotes, like short "new"? maybe Im wrong.
QUOTE Thanks
trpnmonkey41

 
Member Since: Jul 22, 2003
Location: Hamilton College
Posts: 7,003
trpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to behold
Mac Specs: 20" iMac C2D 2.16ghz, 13" MacBook 2.0ghz, 60gb iPod vid, 1gb nano

trpnmonkey41 is offline
You can not use new as a variable name in java, c, c++ or pretty much any language...it is a reserved word

Don't forget to use the new User Reputation System
QUOTE Thanks
nickypaul
Guest
 
Posts: n/a

Sorry, forgot to say that it is C I'm programming in and it's not missing any colons. But to be more specific, the code I'm compiling is part of Csound if any you are familiar with the software synthesis program. So it's code that I should be able to compile without changing anything which is why I figured it might be some sort of compiler flag that I need to set to tell it to ignore the error.

Thanks,
Nick
QUOTE Thanks
Amen-Moses

 
Member Since: Apr 25, 2003
Location: The home of the free and the land that did for Braveheart.
Posts: 1,301
Amen-Moses is just really niceAmen-Moses is just really niceAmen-Moses is just really niceAmen-Moses is just really nice
Mac Specs: 24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs

Amen-Moses is offline
Quote:
Originally Posted by nickypaul
Sorry, forgot to say that it is C I'm programming in and it's not missing any colons. But to be more specific, the code I'm compiling is part of Csound if any you are familiar with the software synthesis program. So it's code that I should be able to compile without changing anything which is why I figured it might be some sort of compiler flag that I need to set to tell it to ignore the error.

Thanks,
Nick
I'd bite the bullet and rename all occurances of it.

IIRC you can use compiler flags to ignore warnings and maybe some ANSI errors but it is usually more hassle than it is worth as some errors if ignored will result un runtime errors which will be a pain in the posterior to debug.

How good are your Perl skills? :cool:

Amen-Moses
QUOTE Thanks
Kokopelli
Guest
 
Posts: n/a

Can you be more precise in the app you are trying to build? If we knew exactly what you ar looking at perhaps that would help. Is there a readme or build text file in the root directory? How about a make file?

If the source was designed for Mac and in a compilable state (according to the author) then you should not do a global search and replace. This would most likley screw up the app.
QUOTE Thanks

Post Reply New Thread Subscribe


« Assembly Programing? | OpenGL - GLUT trouble »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Microsoft Word??? mig.gentry Switcher Hangout 14 08-18-2004 06:44 PM

All times are GMT -4. The time now is 05:53 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?