Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ compilation for iPhone (STL issue?)

I am trying to compile some C++ code as a static library to use on the iPhone. If I compile things for the simulator (i386 architecture), everything compiles just peachy, but when I switch the architecture to arm, I get all these include errors, seemingly within the iPhone SDK STL headers. Any idea what's going on?

First of the errors:

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include/c++/4.2.1/string:45:0 Bits/c++config.h: No such file or directory in 
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include/c++/4.2.1/string
like image 478
toastie Avatar asked Jan 29 '10 05:01

toastie


2 Answers

Add /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/usr/include/c++/4.2.1/armv6-apple-darwin9/ as the include path.

Also, please file a bug to Apple.

like image 101
kennytm Avatar answered Sep 26 '22 13:09

kennytm


To fix this bug for all SDK versions, add

$(SDKROOT)/usr/include/c++/4.2.1/armv6-apple-darwin9

to the "Header Search Paths" build setting (the architecture shouldn't matter; this still works for the simulator for me).

like image 23
bvanderveen Avatar answered Sep 25 '22 13:09

bvanderveen