warning: shared library text segment is not shareable

Issue

I explain my problem :

My project is an android application using C++ with NDK.

I have to include the library ffmpeg into my project.

I’ve built ffmpeg with this tuto : https://github.com/WritingMinds/ffmpeg-android (I’ve looked at the script, it looks like it’s built for a static link)

My cmakelist.txt is working, no error. But when i run my program, i got this message : (i’ve cut it or it’s too long)

[1/1] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/x86/libgestionnaire.so

/local/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: warning: shared library text segment is not shareable

/local/Android/Sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: treating warnings

Best Regards

Solution

Ok guys, so thanks to @textrel and @Tsyvarev, i could resolve my problem, it was pretty easy :

I just added those lines in my cmakelist.txt :

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdgnu++11")

set(CMAKE_SHARED_LINKER_FLAGS "-Wall -v -Wl,--no-warn-shared-textrel")

Best regards

Answered By – S. Le Galloudec

Leave a Comment