S. Le Galloudec
S. Le Galloudec

Reputation: 51

warning: shared library text segment is not shareable

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

Upvotes: 2

Views: 2520

Answers (1)

S. Le Galloudec
S. Le Galloudec

Reputation: 51

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} -std=gnu++11")

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

Best regards

Upvotes: 2

Related Questions