Results 1 to 8 of 8
  1. #1
    nickypaul
    Guest
    XCode (Help with error messages) First - Using the word "new" as a variable
    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'

  2. #2
    Prometheus
    Guest
    On the lines before there isn't a ; missing after another variable is declared is there?

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

    Member Since
    Sep 30, 2004
    Posts
    3,378
    Are you using Objective-C or Java? I know 'new' is a reserved word in Java, I would assume similar for Objective-C.

  4. #4
    XCode (Help with error messages) First - Using the word "new" as a variable
    Macman's Avatar
    Member Since
    Oct 30, 2004
    Location
    San Antonio, Texas
    Posts
    4,374
    Specs:
    PowerMac G4 Cube 450mhz 832mb
    I thought that variable would be in quotes, like short "new"? maybe Im wrong.

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

    Member Since
    Jul 22, 2003
    Location
    Hamilton College
    Posts
    6,999
    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
    Don't forget to use the new User Reputation System

  6. #6
    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

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

    Member Since
    Apr 25, 2003
    Location
    The home of the free and the land that did for Braveheart.
    Posts
    1,301
    Specs:
    24"iMac, 15"MB-Pro, MacBook, G4 iMac, PM G5 2x2Ghz, G4 iBook & Some PCs
    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

  8. #8
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 03-17-2015, 08:06 PM
  2. Replies: 10
    Last Post: 07-07-2014, 06:17 PM
  3. MicroSoft word "error"
    By dkemp in forum OS X - Operating System
    Replies: 1
    Last Post: 04-01-2014, 04:07 PM
  4. "Invalid Characters" error when trying to open a Word document
    By vansmith in forum OS X - Apps and Games
    Replies: 0
    Last Post: 02-09-2014, 12:57 PM
  5. MS Word 2008 "Microsoft Word want to use the font..."
    By robcub in forum OS X - Apps and Games
    Replies: 1
    Last Post: 09-20-2010, 09:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •