Open s-lee-kwong opened 10 years ago
Hi. I am trying to look into that and trying to build and test the same way you do. I know for sure the build is ok up until 1.54.0. 1.55.0 is relatively new and I see more warnings when building it, so I would recommend to stick with some version from 1.51.0 to 1.54.0 for a while.
The "No such file or directory" messages that you see are for OSX, not iOS. It needs to be looked at, but in your case you're trying to run it on iOS so this should be irrelevant.
And I have one wild guess. Could it be that you link your iOS project agains OSX framework? I have no idea how it could happen, so pardon me for trying really crazy guesses :) But I'd recommend to remove osx framework directory and make sure it is not included into Xcode project, then give it another try. Since iOS Simulator is running on OSX you may not notice the mix up until you try to run on actual device. Btw, do you have boost library installed on your Mac? For example installed with homebrew or something else?
Hey,
Thanks for the reply. I will try what you are suggesting and come back with my results. But I was only using the ios build for ios and didn't include the osx one at all.
Also, have a look at your C++ dialect settings.
As I understand you don't use --with-c++11
flag when building, right?
Then make sure that your Xcode project build settings match.
https://github.com/mgrebenets/boost-xcode5-iosx#undefined-symbols-link-error
Ya I made sure all those settings were there as well, even if I don't use the --with-c++11
I also tried doing it with that flag plus the xcode project settings, still no good
Shawn
When I add locale
to list of libs I have the same issue with iconv
. Apparently for locale
either iconv
or icu
is required. Both are not part of boost and should be available as external libraries.
- iconv (separate) : yes
means that's it's using iconv
library installed on the OSX system, thus the build is OK for iOS simulator and OSX.
It looks like iconv
is available for iOS (http://stackoverflow.com/questions/4242914/which-libiconv-should-we-use-on-ios), but it's path must be specified when building boost framework.
http://www.boost.org/doc/libs/1_48_0/libs/locale/doc/html/building_boost_locale.html
Here's the quote from that page.
If iconv library is not found on Darwin/Mac OS X builds
make sure there is no multiple iconv installations
and provide -sICONV_PATH build option to point to correct location of iconv library.
There should be a way to lookup iconv
library in IPHONE_OS_PLATFORM_PATH
and modify writeBjamUserConfig
to include -sICONV_PATH
option for iOS platform.
I will try to do that when I have some time.
Feel free to open PR if you find a solution.
Hey,
Ya I have tried a bunch of ways to include that option and have had no luck, maybe you know more than I do when it comes to including that flag.
Hey, I also just used 1.51.0 of boost with only chrono lib and still was getting the unidentified symbols for architecture when i integrated the framework into my iOS project
Hey, have you been able to figure out the locale stuff at all, I've been trying to pick away at it here and there but I still have no luck with it.
I still get the same problems as I stated above even with the new script you put out there. Still cannot find iconv and I have tried everything you suggested and have come empty so far.
Any help would be greatly appreciated.
Thanks
I couldn't get iconv located either. I know for sure that there is iconv library in iOS, here's how you can find it's path
ICONV_IOS_PATH=$(dirname $(find $(xcrun --sdk iphoneos --show-sdk-platform-path) -name "libiconv*" | tail -1 ) | rev | cut -d/ -f2- | rev)
Then I'm using it when calling bjam
but it doesn't work anyway.
bjam
is supposed to understand -sICONV_PATH
option
-sICONV_PATH=${ICONV_IOS_PATH}
I was following instructions on this page http://www.boost.org/doc/libs/1_48_0/libs/locale/doc/html/building_boost_locale.html There is some information about building for OS X, should be similar with iOS.
I couldn't get anything working.
But I found some really great example of building Boost.
Have a look at this one: https://github.com/PaulWagener/mapnik-ios-framework/blob/master/Makefile#L120-L137
It doesn't build locale
, but it builds regex
with unicode icu
.
The example also does not include arm64
and x86_64
architecture, but it has lots of useful hints.
I don't have much time right now to try to reuse some useful code from that script.
In general, it looks like I will have to refactor the whole build script and use Makefile with proper dependencies instead of bash script.
OK, I will check those out and see if I can get anywhere to.
Thanks a lot for the effort and hope we can get something done in the future to get this working!
Did either of you guys had any luck with this? Am struggling to get boost locale working but getting the same linker error on Xcode. Undefined architecture for armv7. Any help will be appreciated. Thanks.
Unfortunately I have not had the time to look into the problem anymore. So no fix for me over here.
Sorry.
In case anyone else ends up on this page looking to build boost_locale for iOS I did find that cloning https://github.com/PaulWagener/mapnik-ios-framework/ and adding locale to the list of boost libraries in the makefile successfully built the boost_locale.a for ios/armv7 (entire project did not build, but got far enough to compile boost). Successfully linked against an iOS project I was working on but never actually tried using it at runtime.
I found a new solution described in http://metashapes.com/blog/building-boost-locale-ios/
But it doesn't work.
But the author said 》 The path may very well get down to the compilation statement, but the test simply does not compile at all.
So I try to modify the fount-iconv method in the location: boost_1_62_0/libs/locale/build
Directly to modify the file "Jamfile.v2" on the line 229, set found-iconv variable always true, like: found-iconv = true ;
It seems work for me.
So I modified the script to only build the boost locale module.
I replaced
to ${BOOST_LIBS:="locale"} BOOST_LIBS="$BOOST_LIBS"
then ran ./boost.sh clean -v 1.55.0, having the boost_1_55_0.tar.bz2 in the same folder
and it completed successfully but when I use it as a framework in iOS, I would get undefined symbol errors for arm7, i386 etc
I looked at the framework and got this:
so I looked more closely to the log and found this
so I investigated the stack trace and found this when trying to bjam the iphone build
Performing configuration checks
For the other builds like simulator and osx it did find iconv, as an example
Performing configuration checks
So I was wondering if anyone had an idea about iconv or ICU for the iphone build.