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

N

nickypaul

Guest
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'
 
OP
P

Prometheus

Guest
On the lines before there isn't a ; missing after another variable is declared is there?
 
Joined
Sep 30, 2004
Messages
3,378
Reaction score
61
Points
48
Are you using Objective-C or Java? I know 'new' is a reserved word in Java, I would assume similar for Objective-C.
 
Joined
Oct 30, 2004
Messages
4,374
Reaction score
55
Points
48
Location
San Antonio, Texas
Your Mac's Specs
PowerMac G4 Cube 450mhz 832mb
I thought that variable would be in quotes, like short "new"? maybe Im wrong.
 
Joined
Jul 22, 2003
Messages
6,999
Reaction score
187
Points
63
Location
Hamilton College
Your Mac's Specs
20" iMac C2D 2.16ghz, 13" MacBook 2.0ghz, 60gb iPod vid, 1gb nano
You can not use new as a variable name in java, c, c++ or pretty much any language...it is a reserved word
 
OP
N

nickypaul

Guest
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
 
Joined
Apr 25, 2003
Messages
1,301
Reaction score
62
Points
48
Location
The home of the free and the land that did for Bra
Your Mac's Specs
24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs
nickypaul said:
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
 
OP
K

Kokopelli

Guest
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.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top