Problems getting iPhone example running on simulator

10 views
Skip to first unread message

Paul Barry

unread,
Apr 19, 2009, 10:47:10 PM4/19/09
to Programming Nu
I'm trying to follow the instructions here for getting Nu to run on
the iPhone:

http://floatopian.com/~reddaly/nu-iphone.html

But when I try to run the example in the simulator, it complains, I
think because the libNu.a is the wrong architecture. Here's the full
error:

Building target “nuPhone” of project “nuPhone” with configuration
“Debug” — (2 errors)
cd /Users/pbarry/Spikes/nuPhone
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/
Developer/usr/bin:/Developer/usr/bin:/Library/Frameworks/
Python.framework/Versions/Current/bin:/opt/local/bin:/opt/local/sbin:/
usr/local/bin:/usr/bin:/bin:/usr/sbin/:/sbin:/Users/pbarry/bin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/
gcc-4.0 -arch i386 -isysroot /Developer/Platforms/
iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk -L/
Users/pbarry/Spikes/nuPhone/build/Debug-iphonesimulator -L/Users/
pbarry/Spikes/nuPhone -F/Users/pbarry/Spikes/nuPhone/build/Debug-
iphonesimulator -filelist /Users/pbarry/Spikes/nuPhone/build/
nuPhone.build/Debug-iphonesimulator/nuPhone.build/Objects-normal/i386/
nuPhone.LinkFileList -mmacosx-version-min=10.5 -all_load -ObjC -ledit -
lffi -framework Foundation -framework UIKit -framework CoreGraphics -
lNu -lpcre -o /Users/pbarry/Spikes/nuPhone/build/Debug-iphonesimulator/
nuPhone.app/nuPhone
ld warning: in /Users/pbarry/Spikes/nuPhone/libNu.a, file is not of
required architecture
Undefined symbols:
"_NuInit", referenced from:
-[nuPhoneAppDelegate applicationDidFinishLaunching:] in
nuPhoneAppDelegate.o
".objc_class_name_Nu", referenced from:
literal-pointer@__OBJC@__cls_refs@Nu in nuPhoneAppDelegate.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
"_NuInit", referenced from:
-[nuPhoneAppDelegate applicationDidFinishLaunching:] in
nuPhoneAppDelegate.o
".objc_class_name_Nu", referenced from:
literal-pointer@__OBJC@__cls_refs@Nu in nuPhoneAppDelegate.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Build failed (2 errors)

Can you run Nu on the simulator?

Jeff Buck

unread,
Apr 19, 2009, 11:12:41 PM4/19/09
to Programming Nu
Hi Paul,

If you didn't change the Nukefile in the iPhone directory, you
probably built the Nu static library for the iPhone device, not the
simulator. See this post for details:
http://groups.google.com/group/programming-nu/msg/8ccf52d9949a8bd3

Jeff

Paul Barry

unread,
Apr 19, 2009, 11:47:27 PM4/19/09
to Programming Nu
Now I have this error:

Undefined symbols:
"_mach_override", referenced from:
_nu_disableNSLog in libNu.a(overrides.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
"_mach_override", referenced from:
_nu_disableNSLog in libNu.a(overrides.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

Blake Winton

unread,
Apr 20, 2009, 12:40:35 AM4/20/09
to program...@googlegroups.com
I had that error too. I "solved" it by editting the function
(disableNSLog) that was trying to call mach_override, and commenting
out the call.

I'm fairly sure that's not the right thing to do, but it got the
library compiling, linking, and running on the simulator, so I'm happy
with it for now.

Later,
Blake.
--
Sent from my iTouch.

Tim Burks

unread,
Apr 20, 2009, 12:53:43 AM4/20/09
to program...@googlegroups.com
That's fine. That disableNSLog function is only to get rid of an
annoying Cocoa warning message. There's nothing in Nu that uses
mach_override for the iPhone.

Tim

Blake Winton

unread,
Apr 20, 2009, 10:47:21 AM4/20/09
to program...@googlegroups.com
On 4/20/09 12:53 AM, Tim Burks wrote:
> That's fine. That disableNSLog function is only to get rid of an
> annoying Cocoa warning message. There's nothing in Nu that uses
> mach_override for the iPhone.

In that case, here's a diff of the changes I made. :)

It seems to work for me, YMMV.

Later,
Blake.

mach_override.diff
Reply all
Reply to author
Forward
0 new messages