Problem Building libNu.a for iPhone Simulator 3.0

2 views
Skip to first unread message

neror

unread,
Aug 24, 2009, 4:27:19 PM8/24/09
to Programming Nu
Hi all. I'm trying to build libNu.a to integrate into an iPhone
project, and I'm having trouble getting it to compile for the iPhone
simulator with the 3.0 SDK. It builds arm version for the device fine
(after a minor tweak to the Nukefile to make it use gcc-4.2). When I
try to build for the simulator, gcc fails when including some
framework headers. The trace ends up here:

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
iPhoneSimulator3.0.sdk/System/Library/Frameworks/Security.framework/
Headers/SecKey.h:257: error: expected declaration specifiers or ‘...’
before ‘SecPadding’

Here's a link to the full output and the diff of my changes to the
Nukefile: http://gist.github.com/174144

I'm probably missing something simple like a compiler flag, but I have
no idea what it could be. You'd think that gcc would be able to
compile the Apple headers. Any help would be greatly appreciated.
Thanks!

-Nathan

Jeff Buck

unread,
Aug 24, 2009, 7:33:55 PM8/24/09
to Programming Nu
Hi Nathan,

The compiler is skipping over the SecPadding typedef at the top of
SecKey.h.

If you add '-D__IPHONE_OS_VERSION_MIN_REQUIRED=20000' to the @cflags
line in the Nukefile, it should build libNu.a:

(set @cflags "-g -Iinclude -I../include -DMININUSH -DDARWIN -DIPHONE -
DMACOSX -D__IPHONE_OS_VERSION_MIN_REQUIRED=20000 -std=gnu99 #
{PLATFORM} ")

I'm not sure who is supposed to be setting
__IPHONE_OS_VERSION_MIN_REQUIRED (or if that value is a good one to
use), but that fixes the compiler error.

I didn't try the resulting libNu.a so there may be more problems
lurking, but hopefully that will get you going on your way.

Jeff

neror

unread,
Aug 25, 2009, 6:29:52 PM8/25/09
to Programming Nu
Thanks, Jeff! That definitely fixed the build problem. I looked at
that #ifdef a bunch of times, and it never clicked for some reason. :-
P Now to try and actually use it...
Reply all
Reply to author
Forward
0 new messages