1

After trying several solutions I think I need some help on understanding how to build Boost properly for Mac OSX Lion, building a crossplatform app on XCode 4 with no success =s

I've followed this guide. And did the following commands in sequence:

cd /Users/me/Documents/boost_1_53_0
./bootstrap.sh --prefix=installation
cd /Users/me/Documents/boost_1_53_0/tools/build/v2
./bootstrap.sh
./b2 install --prefix=installation
export PATH=$PATH:installation/bin
cd /Users/me/Documents/boost_1_53_0
./b2 --build-dir=installation toolset=darwin cxxflags="-arch i386" address-model=32 architecture=x86 stage

I got the error in the title of the question after attempting to compile an app on XCode, with these edits:

Added these libs to the "Link Binary With Libraries" under "Build Phases":

libboost_filesystem.dylib
libboost_system.dylib

And added "$(SRCROOT)/../boost_1_53_0" to the Header and Library Search Paths.

Looking at some other questions here on Stackoverflow lots of people seem to build boosts with makefiles and passing things like LDFLAGS=-L/opt/local/lib in the makefile;

Where can I find a good tutorial or example for building boost? I have no experience with crafting makefiles of my own, although I have messed with some with a few simple edits here and there.

Hobbyist
  • 885
  • 2
  • 10
  • 23
  • what are you trying to do with `cxxflags="-arch i386"`? – Sam Miller Mar 28 '13 at 22:08
  • 1
    The steps you've posted are for building Boost, while the title seems to be a linker error from trying use the Boost libraries. So what's your question? Are you having trouble building the Boost libs, or using them? – Praetorian Mar 28 '13 at 22:11
  • @Praetorian That is the error resulted in using the boost I built with those options, I wish to know how a generic process of building boost and using it with Xcode looks like. – Hobbyist Mar 28 '13 at 22:14
  • @SamMiller I tried building with that flag after looking at several other questions here on SO, am I on the wrong track? =s – Hobbyist Mar 28 '13 at 22:17
  • It's difficult to say you're on the wrong track, your question isn't clear. If you're trying to build a 32 bit version of the boost libraries, what you're doing is correct. – Sam Miller Mar 28 '13 at 22:30
  • @SamMiller I'm unsure if those build options are the source of the linker error, how can I better phrase the question? – Hobbyist Mar 28 '13 at 22:37
  • What, and how, are are you building when you encounter the linker error about `-lboost_system not found`? Update your question with a [sscce](http://sscce.org) containing that information. – Sam Miller Mar 28 '13 at 22:39
  • @SamMiller Does my last edit make my question any more clearer? I can't exactly provide the entire program as it's rather large =s – Hobbyist Mar 28 '13 at 22:50
  • could you solve your problem? I get the same error right now when trying to install glogg. I think boost was correctly installed. I am also on a mac osx. – Verena Haunschmid May 17 '13 at 13:31
  • @ExpectoPatronum Sadly nope, I used c++11 as an alternative to what I was trying to do. – Hobbyist May 23 '13 at 17:12

1 Answers1

-1

Check where are your boost dylibs are. May be it is under some intermediate directory in "$(SRCROOT)/../boost_1_53_0"? For example "$(SRCROOT)/../boost_1_53_0/lib". If so add whole path to the "Library Search Paths" in Build Settings.
By the way: are you sure you want to link dynamically and not statically?

cody
  • 3,233
  • 1
  • 22
  • 25
  • I've tried specifying the paths for each Header and Library Search Paths too, in hopes of that being the problem, then I defaulted back to the root path due to uncertainty. I'd like to link statically, but found no alternatives, can you show me an example? – Hobbyist Mar 29 '13 at 09:36
  • This is not about Header Paths, just Library Search Paths. Now to link statically you need to compile boost statically (i.e add `link=static` attr when running b2) see http://boost.2283326.n4.nabble.com/Install-boost-on-OS-X-via-homebrew-with-c-11-and-libc-tt4635648.html#a4635677 for some idea (scan through whole thread - its helpful). After that you should have libraries with .a extension, add them instead of dylibs. – cody Mar 29 '13 at 09:49
  • Seems like I'm way in over my head, I should perhaps ask 'How to build and compile Boost for the iPhone' instead of errors which may be a result of incorrect compilation =s – Hobbyist Mar 29 '13 at 10:46
  • You shouldn't ask that, there is such question already: http://stackoverflow.com/questions/1577838/how-to-build-boost-libraries-for-iphone – cody Mar 29 '13 at 10:56
  • You also can look at http://www.danielsefton.com/2012/03/building-boost-1-49-with-clang-ios-5-1-and-xcode-4-3/ It is more recent – cody Mar 29 '13 at 11:07
  • Thanks for the resources, I took a look at them and saw that they were all ready made and out of the box but I don't quite grasps how they are made, I wish to learn how, is that advisable? – Hobbyist Mar 29 '13 at 11:29
  • Well, in that case you really need to ask other question so that some boost guru can answer, but before I suggest scan through SO and nice start is links in right pannel (Related) – cody Mar 29 '13 at 12:32