So I am trying to build boost 1.55 for android, but I am getting linking errors for Boost.System and Boost.Atomic, that say "error: cannot find -lrt". Of course, android doesn't have librt because its built into the C runtime. So, I am trying to get boost so it won't link to librt. I tried just deleting every "-lrt" in the source code:
find . -type f | xargs -n1 -P 8 sed -i "s/-lrt//g"
But I still get the same error. How do I make boost not link against librt for android?
Indeed all occurrencies of -lrt
with sed doesn't seem to have any impact on the problem.
What worked for me (in boost 1.53.0 though) is the following:
tools/build/v2/tools/gcc.jam
Comment libs = rt ;
in this code section (By the way, it could be that you do not have the -pthread
option line):
case * :
{
option = -pthread ;
libs = rt ; <--Comment this line
}
Note: As initial/brute force solution, I would take the failed commands and manually run them removing -lrt
from them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With