HI,
I am getting the following linker error on linux: My guess is it is missing '-lpthread' in开发者_JS百科 the linker thread. My question is if there is a way for me to set my environment on linux such that it will add '-lpthread' when it links?
/usr/bin/ld: out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/libutils.a(Threads.o): in function androidCreateRawThreadEtc:frameworks/base/libs/utils/Threads.cpp:145: error: undefined reference to 'pthread_create'
Thank you.
You need to tell us more about how exactly you are compiling with gcc.
For example, if you are using a Makefile, the you can add -lpthread
to the CFLAGS
environment variable.
Edit: If you compile and link in two steps, then you should use the LDFLAGS
environment variable for controlling the linker flags.
精彩评论