Results 1 to 7 of 7

Thread: Mac Developers -Help! Problem Building App in Xcode

  1. #1
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,359
    Blog Entries
    2

    Mac Developers -Help! Problem Building App in Xcode

    I know this is probably the wrong place to ask a technical question about Xcode, but I'm going to take a shot at it.

    I've been coding a front end app using applescript in Xcode. The "build and go" process has worked fine. I recently tried to build the app using the "deployable" build style and have run into problems getting it to build at all anymore. The build fails with the following information:

    Building target “iView” with build style “Deployment” (optimization:level ‘size’, debug-symbolsn) — (1 error, 1 warning)
    /usr/bin/gcc-3.3 -o /Users/tberry/Desktop/iView/Harmony.app/Contents/MacOS/Harmony "-L/Users/tberry/Desktop/iView" "-F/Users/tberry/Desktop/iView" -filelist /Users/tberry/Desktop/iView/iView.build/iView.build/Objects-normal/LinkFileList "-arch" "ppc" "-prebind" "-Wl,-no_arch_warnings"
    ld: warning prebinding disabled because of undefined symbols
    ld: Undefined symbols: _NSApplicationMain

    Build failed. (1 error, 1 warning)


    Any ideas what this "undefined symbol" is? Any help is appreciated.
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    Want to:
    -Find out about the new iBug iPad install?
    -Find out about carPC's in just 5 minutes? View the Car PC 101 video

  2. #2
    Newbie
    Join Date
    Apr 2005
    Posts
    10
    Undefined symbols means that the linker cannot find that function/external variable when it links/binds the application together.

    NSApplication is the main class that all application is built upon.

    I got the same message when I "deployed" my application for a couple of Quicktime functions and that was because I didn't include the Quicktime.frameworks (that shouldn't be the case for you).

    I haven't tried the applescript approach in Xcode but the error message should be the same whichever language you use.

    Try to clean all targets before you build, maybe that can solve your problem.

  3. #3
    Low Bitrate BenjaminS's Avatar
    Join Date
    Mar 2005
    Posts
    101
    Just a shot in the dark, but an undefined _NSApplicationMain may mean your missing the Cocoa/Cocoa.h imports.

    Just to reiterate what Ph75 said, you might be missing frameworks. Make sure that Cocoa.framework and AppKit.framework are both in you Frameworks folder in xcode.

    Also try deleting the build directory in the project dir. That basically forces a clean build and might solve the problem.

    Possibly your main.m file could have been corrupted some how. It happened to me once, coming out of a tarball my main.m file contained half my project code :P.

    If you still can't get this to work, try asking a question on the apple mailing lists. They are always very helpful.

    If you really still can't get it to work, wrap it up in a tarball and post if somewhere so we can take a look at it :P
    BenjaminS
    Powered by Imagination
    http://www.ccarproject.net/

  4. #4
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,359
    Blog Entries
    2
    Wow! I appreciate the speedy replies. I've attached a screen capture of the Xcode window for a bit more info.

    1. I tried "Clean all targets" but that didn't help.
    2. I changed the build directory to a completely different location but no help.
    3. I deleted the build directory before building but that didn't help.
    4. According to Xcode, the Cocoa framework and Appkit framework are there and there's lots of headers.

    [Edit:] One other potentially significant piece of information - I originally named this application "iView". I then decided to rename it "Harmony". I found a posting about how to change the app's name without having to reimport all the files into a new project. I changed the name of the app in the "Project --> Edit active target iView". I wonder if this didn't mess it up. You can see in the screenshot that the app generated is Harmony but the target is iView.

    I have a feeling that my main.m got corrupted somehow. I'm not certain what it's supposed to look like, though.

    If you wouldn't mind just taking a look at the screenshot and see if everything looks okay. If it does, I'll take this question to the Apple list serve. They've been mighty helpful with Applescript questions.
    Attached Images Attached Images  
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    Want to:
    -Find out about the new iBug iPad install?
    -Find out about carPC's in just 5 minutes? View the Car PC 101 video

  5. #5
    Low Bitrate BenjaminS's Avatar
    Join Date
    Mar 2005
    Posts
    101
    Well the main.m file looks correct for an apple script application, try adding this
    Code:
    #import <mach-o/dyld.h>
    #import <Cocoa/Cocoa.h>   //add this line
    BenjaminS
    Powered by Imagination
    http://www.ccarproject.net/

  6. #6
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,359
    Blog Entries
    2
    I did that, but it didn't help, but I've fixed my immediate problem. I just created a new project, named it the right name and imported the files from the damaged project.

    It built and worked, so I'm okay.

    Thanks for the suggestions, Ben and Ph.
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    Want to:
    -Find out about the new iBug iPad install?
    -Find out about carPC's in just 5 minutes? View the Car PC 101 video

  7. #7
    Low Bitrate BenjaminS's Avatar
    Join Date
    Mar 2005
    Posts
    101
    Yeah that was my next suggestion. You perhaps might want to send a bug report to apple about this. It never hurts to do so.
    BenjaminS
    Powered by Imagination
    http://www.ccarproject.net/

Similar Threads

  1. Alpine City Cruise
    By Hell-Stopper in forum RR Skins
    Replies: 170
    Last Post: 02-22-2007, 10:05 PM
  2. Replies: 7
    Last Post: 04-18-2005, 12:41 PM
  3. External App Problem
    By scott011422 in forum Media Engine
    Replies: 0
    Last Post: 03-08-2005, 02:28 PM
  4. Replies: 67
    Last Post: 02-28-2005, 04:25 PM
  5. Hot Rod Company to start incorporating Mac Minis
    By stacheldraht in forum MacCar
    Replies: 4
    Last Post: 02-01-2005, 12:25 PM

Bookmarks

Posting Permissions

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