When I add the libraries to the project (right-click on the project name, then Add Existing...), I get this:

ld: warning: in /Users/eric.grunin/dev/iOS/icu/source/lib/libicudata.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Users/eric.grunin/dev/iOS/icu/source/lib/libicui18n.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Users/eric.grunin/dev/iOS/icu/source/lib/libicuio.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Users/eric.grunin/dev/iOS/icu/source/lib/libicule.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Users/eric.grunin/dev/iOS/icu/source/lib/libiculx.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Users/eric.grunin/dev/iOS/icu/source/lib/libicutu.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Users/eric.grunin/dev/iOS/icu/source/lib/libicuuc.a, file was built for unsupported file format which is not the architecture being linked (i386)

That's why I think I'm building the library incorrectly. It's as if it's saying:

It can't tell what architecture the .a files are built for

libsqlite3-cerod.a is built for i386

I don't understand either possibility, but I'm new to iPhone development.

Edited to add

I tried @Sergio Moura's solution, and got the error mentioned in my comment.

I tried @sergio's solution, which built. But I'm still getting the equivalent errors, starting with:

ld: warning: in /Users/eric.grunin/dev/iOS/icu/iosbuild/lib/libicudata.a, file was built for unsupported file format which is not the architecture being linked (i386)

Might I be telling Xcode the wrong thing? I'm right-clicking on the project name, then selecting "Add->Existing File", and choosing the six or seven

.a

files from

/icu/iosbuild/lib

. Is that the correct process?

Note:

@sergio is recommending

configure --host=arm-apple-darwin

, @Sergio Moura is using

configure --target=arm-apple-darwin

. Neither made a difference, alas.

Edit #2

Targeting the device (instead of the emulator) solved all but one of the link errors! Here's what's left:

) made no difference, alas. I also realized that the last line of the error (

not found for architecture arm6

) didn't mean it would work for

arm7

, it was only an fyi that this was a cross-compile. When I specified an

arm7

build, it failed with the same messages. Alas.

Edit #4

Success!

Summary: @sergio's build flags were essentially correct. I added -DU_HAVE_GCC_ATOMICS=0 to the ios build's CFLAGS. The one thing I had been doing wrong was not realizing I needed to cross-compile the library to create a device build.

I haven't tried to repeat this for the simulator, but that's outside the scope of my question.

Special thanks to Steven R. Loomis for pitching in, and to Sergio Moura for getting things rolling.

cross-compiling libicu for iOS by also specifying the cross-compile directory.

The reason why step 1 is necessary is that libicu will bootstrap itself a bit, i.e., it will compile some intermediate tools, which will be then used in the rest of the build process; those tools need to be ran on the host platform, so they are to be available.

In the above script (source), ICU_PATH is an absolute path because libicu configure so requires for the with-cross-build option. Again, check your values for the SDK and compilers, but this should be ok for 4.3.

Finally, you should take into account that Apple has (half) rejected at least one app that was linked against libicu, because it uses reserved APIs. Have a look at this S.O. topic.

EDIT:

happy the hear that you could compile!

now, to the linking problem.

first of all, please check that the libicu libraries are in the correct format: