Comments (4)
Not sure if understand your problem correctly, but to solve problems with undefined references to STL I use this ugly hack in our project:
LOCAL_LDLIBS := -lboost_filesystem-$(GCC_POSTFIX) -lboost_system-$(GCC_POSTFIX) -lboost_regex-$(GCC_POSTFIX) -lboost_thread-$(GCC_POSTFIX) -lgnustl_static
LOCAL_LDFLAGS += -L$(LOCAL_PATH)/boost/lib/
LOCAL_LDFLAGS += -L$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/$(GCC_VERSION)/libs/armeabi-v7a/
It means, I add -lgnustl_static
at the end of LDLIBS and path to it to LDFLAGS. Usualy problem is caused by having linking with stl mentioned before libraries that use it in the linker call. To see actual calls ndk-build does you can run it with -n
option. Hope this helps.
from boost-for-android.
Thank you for the answer.
I'm building the app by using bjam, I wrote Jamroot and Jamfiles for my projects.
I added path to stl /lib and stl library file name explicitly as linker option via <linkflags> when
defining toolset in user-config.jam:
using gcc : android4.8 :
: <linkflags>-L$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi
<linkflags>-lgnustl_static
<linkflags>--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-9arh-arm
<compileflags>--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-9arh-arm
...
;
I also added sysroot to linker too. It did the trick (no unresolved extrnals). But the only one problem left. I see '-lrt' in linker command line. I can't realize where it comes from. I tried to copy the g++ command line bjam provides on link failure and remove -lrt, app builded.
How to get rid of librt.a (-lrt)? It seems boost.build includes this option. I will investigate. If you had any idea on this, I would be really apprecited to hear it.
Regards.
from boost-for-android.
Hi, I remember looking for that flag as well some time ago. But for a different reason I think.
Try the file: BOOST_DIR/tools/build/v2/tools/gcc.jam
Line: 1071 (depends on boost version I guess, do a search for "setup-threading" in that file)
EDIT: My solution was to comment out the line "libs = rt ;", see this commit.
from boost-for-android.
Thank you, that is I looked for!
from boost-for-android.
Related Issues (20)
- Could not find a suitable toolset. HOT 1
- Bump boost version to 1.77 and disable statx syscall HOT 1
- Error before patch, on windows, how to fix? HOT 1
- when Suppport 1.7.7?
- Fixed ndk[19,20,21,22] building failed bug.
- Can you update the shell of 1.77.0 version ,thanks
- Error: No best alternative for libs/context/build/asm_sources HOT 1
- i build boost success but i build project faild HOT 5
- build-boost-without-version-number-suffixes
- Boost 1.74.0 armv7a
- boost_version for 1.72.0
- windows does not compile HOT 3
- "Undefined or not supported Android NDK version: 23.2" on GitHub Actions HOT 2
- fail to identify Windows when using '--with-conv'
- Can't build NDK
- Open source license HOT 2
- How to generate shared libboost_xxxx.so without the version number such as .so.1.74.0 HOT 2
- Please stop requiring approvals for pull requests HOT 3
- Add NDK 26.1 and 26.2 to build-android.sh
- Build Boost 1.70.0 By NDK r21e, product libthread libsystem size is unnormal
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boost-for-android.