Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7075793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:13:12+00:00 2026-05-28T06:13:12+00:00

I’ve got an iPhone app that runs on the device. Now I need to

  • 0

I’ve got an iPhone app that runs on the device. Now I need to run it in the Simulator.

It uses an open source project (http://site.icu-project.org/), which I build from the command line to create arm-compatible .a files. I can link these with my iPhone project, and it runs on the device.

If I switch the target to Simulator, the build fails, as I expected:

ld: warning: in libicudata.a, file was built for unsupported file format which is not the
architecture being linked (i386)

But if I use libs compiled for local use (x86_64), I get the same error, which has got be baffled. Do I have to specify a third architecture for the Simulator? Which one? How do I set the configuration?

For reference, this is how I configured the icu project for the two different targets: How to build ICU so I can use it in an iPhone app?

Edited to add:

As Guillaume suggested (and Connect iPhone App to PostgreSQL Using Libpq confirmed), I now see that the emulator needs a 32-bit build. So that’s the last part: how do I set the configuration?

The library has a standard configure script, as far as I know, but I’m still pretty new at this.

Edited to add:

I’ve gotten this far, but the references to i686 are obviously wrong.

I don’t know if i386 is considered a cross-compile, if it is I need “host” and “target” options, too.

ICU_PATH=/Users/eric.grunin/Documents/dev/icu2

DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer
SDKROOT=$DEVROOT/SDKs/iPhoneSimulator4.3.sdk
SYSROOT=$SDKROOT

ICU_FLAGS="-I$ICU_PATH/source/common/ -I$ICU_PATH/source/tools/tzcode/ "

export CXXPP=
export CXXPPFLAGS=
export CPPFLAGS="-I$SDKROOT/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I$SDKROOT/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I$SDKROOT/usr/include/ -I$SDKROOT/usr/include/c++/4.2.1/armv7-apple-darwin10/ -I./include/ -miphoneos-version-min=2.2 $ICU_FLAGS"

export CFLAGS="$CPPFLAGS -pipe -no-cpp-precomp -isysroot $SDKROOT"
export CPP="$DEVROOT/usr/bin/cpp $CPPFLAGS"
export CXXFLAGS="$CFLAGS" 

export CC="$DEVROOT/usr/llvm-gcc-4.2/bin/i686-apple-darwin10-llvm-gcc-4.2"
export CXX="$DEVROOT/usr/llvm-gcc-4.2/bin/i686-apple-darwin10-llvm-g++-4.2"
export LDFLAGS="-L$SDKROOT/usr/lib/ -isysroot $SDKROOT -Wl,-dead_strip -miphoneos-version-min=2.0"

cd $ICU_PATH
mkdir simbuild
cd simbuild

$ICU_PATH/source/configure --enable-static --disable-shared 
gnumake
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:13:13+00:00Added an answer on May 28, 2026 at 6:13 am

    This is how I got it to work. I’m putting it here so I can look it up later.

    It’s likely this is imperfect, feel free to correct it. Comments try to separate what’s generic from what’s specific to the ICU library I was building.

    // This is is required by the ICU configure step
    
    # must be ABSOLUTE PATH
    ICU_PATH=/Users/eric.grunin/Documents/dev/icu2
    
    // First crucial bit: specify the Simulator
    
    DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer
    SDKROOT=$DEVROOT/SDKs/iPhoneSimulator4.3.sdk
    SYSROOT=$SDKROOT
    
    // for convenience
    
    ICU_FLAGS="-I$ICU_PATH/source/common/ -I$ICU_PATH/source/tools/tzcode/ "
    
    export CXXPP=
    export CXXPPFLAGS=
    
    // current version of gcc is missing some #include files, we have to get them elsewhere
    
    export CPPFLAGS="-I$SDKROOT/usr/include/c++/4.2.1/i686-apple-darwin10/ -I$SDKROOT/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I$SDKROOT/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I$SDKROOT/usr/include/ -I$SDKROOT/usr/include/c++/4.2.1/armv7-apple-darwin10/ -I./include/ -miphoneos-version-min=2.2 $ICU_FLAGS"
    
    // MUST specify -arch i386
    
    export CFLAGS="$CPPFLAGS -pipe -arch i386 -no-cpp-precomp -isysroot $SDKROOT"
    export CPP="$DEVROOT/usr/bin/cpp $CPPFLAGS"
    export CXXFLAGS="$CFLAGS" 
    
    export CC="$DEVROOT/usr/bin/gcc"
    export CXX="$DEVROOT/usr/bin/g++"
    
    // MUST add -arch i386 here.
    // Also: to avoid "undefined symbol: _Unwind_Resume", add -lgcc_eh
    
    export LDFLAGS="-arch i386 -L$SDKROOT/usr/lib/ -lgcc_eh -isysroot $SDKROOT -Wl,-dead_strip -miphoneos-version-min=2.0"
    
    cd $ICU_PATH
    mkdir simbuild
    cd simbuild
    
    // Not sure if --host is really needed
    
    $ICU_PATH/source/configure --enable-static --disable-shared --host=i686-apple-darwin10
    gnumake
    

    I’m probably not going to make a fat binary, because the ICU library is already very large and I need to keep the final app as small as possible.

    Edited to add

    I tried the fat library approach: it tripled the size of my app, alas.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.