faithfracture / Apple-Boost-BuildScript

Script for building Boost for Apple platforms (iOS, iOS Simulator, tvOS, tvOS Simulator, OS X)
279 stars 111 forks source link

building iostreams (missing objects) #17

Closed liran999 closed 7 years ago

liran999 commented 7 years ago

hey guys ! i'm trying to build iostreams for ios using this script ... i have added iostreams to BOOST_LIBS and i was able to build iostream, BUT... it seams that the static lib i got is missing some objects.. for example zlib, gzip .... can i do anything about that ?

thanks !!!!

faithfracture commented 7 years ago

I'll start with stating that I don't use iostreams, so the rest of this is just a guess.

Boost itself doesn't include gzip, zlib, etc, so the fact that the resulting static library file doesn't include them isn't surprising. Looking at one of the comments from https://stackoverflow.com/questions/7282645/how-to-build-boost-iostreams-with-gzip-and-bzip2-support-on-windows, it seems that you can get Boost to link to zlib & gzip by adding an environment variable (or setting one in the current shell) prior to executing the script. That seems to be the easiest option. The other one would require a modification to the build script to provide include paths to the missing libraries for the linker.

Making the script change is totally doable, but unless you have an undetermined amount of time to wait on me to do it, you'll be better off trying the first solution (or making the modification yourself).

If adding the libraries to the environment doesn't work and you don't want to / can't / don't know how to modify the script to pass them to the boost builder, I'll add it to my list of things to work on for this. I'm assuming you're doing this for a macOS project? If you colud provide a sample project to work with it would be really super helpful.

liran999 commented 7 years ago

thank you so much man, the ZLIB_SOURCE environment variable worked !

faithfracture commented 7 years ago

Awesome, thanks for the update. I'll add some documentation about that in case anyone else has the same problem.

deshan commented 3 years ago

@faithfracture Thanks for this. Saved lot of time.

Trying to build boost iostream with zlib enabled.

I did as liran999 said above

thank you so much man, the ZLIB_SOURCE environment variable worked !

But gave me errors when run ./boost.sh -ios

darwin.compile.c iphone-build/boost/bin.v2/standalone/zlib/darwin-~iphone/release/link-static/threading-multi/visibility-hidden/adler32.o
error: invalid argument '-std=c++14' not allowed with 'C'

below is the build log. ios-build.log

Thanks

deshan commented 3 years ago

With below managed to fix, for anyone needs it

  1. Setting environment var ZLIB_SOURCE=....
  2. In boost.sh remove -std and -stdlib options from OTHER_FLAGS
  3. May need to run ./configure inside zlib source