0

I'm looking to build boost's Serialization library on Windows, for Android. I have downloaded Android NDK r8d, and boost 1.53.

Step 1 in this process is installing boost.build, to get me a bjam or b2 executable I can use to build the library.

So I go to boost_1_53_0/tools/build/v2 and run boostrap.bat, as instructed here: http://www.boost.org/doc/libs/1_53_0/more/getting_started/windows.html

and it fails.

'cl' is not recognized as an internal or external command

bootstrap.log suggests the script is using msvc. Googling this problem, I find solutions suggesting I try to add GCC to my path and append GCC to the bootstrap command.

Now, I don't have minGW installed yet. However, I don't think I want to be using the minGW GCC, since that's not what I'm going to be building the boost libraries or my code with; I'm going to be using the GCC provided by the Android NDK.

Am I right in assuming that it is significant which compiler Boost.Build is built with? If so, how do I get past this problem? Adding the NDK compiler location to Path and attempting to bootstrap with arm-linux-androideabi-g++ doesn't work; the bootstrap log says its not a supported toolset, and that I should use mscv, gcc, etc..

Wes Paugh
  • 161
  • 1
  • 10

1 Answers1

0

You should add the NDK toolchain to user-config.jam and select this toolset in bjam line. Please see the following question.

Update: You can build bjam with MSVC and then use it to invoke Android NDK toolset.

Community
  • 1
  • 1
Igor R.
  • 14,716
  • 2
  • 49
  • 83
  • The solution you linked in that link is actually what brought me to this problem. Trying to just run b2 or bjam from boost root is not a recognized command. Boost's documentation suggests to run build/v2 bootstrap to build b2 and add it to Path. Doing so requires I provide bootstrap.bat with c++ compiler, which lead me to this question. Would you mind elaborating, or correcting my faulty assumptions? – Wes Paugh Mar 13 '13 at 16:21
  • @Wes Paugh Ah, sorry, I misread your question. You should run booststrap.bat from boost root, not from build/v2. At least that's what I always do, and it works fine so far. – Igor R. Mar 13 '13 at 16:27
  • Thank, I think that answers my question. If you've bootstrapped with the default compiler (rather than "bootstrap.bat gcc") then b2 and bjam would have been built using msvc or other system c++ compiler, not the android one. So, the answer to my question ought to be, 'No, you can build b2 and bjam with any c++ compiler available, and still specify the NDK compiler when building the boost libraries like Serialization by modifying user-config.jam'. Thank you! I'll mark this an answer once I've tested it. – Wes Paugh Mar 13 '13 at 16:35