gavinpugh / vs-android

Integrated development of Android NDK C/C++ software with Microsoft Visual Studio.
Other
119 stars 34 forks source link

-fPIC flag is required for android #124

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
C++ code must be generated using for shared library. And for this flag -fPIC 
must be specified

Original issue reported on code.google.com by SergeySo...@gmail.com on 22 Jul 2014 at 8:48

GoogleCodeExporter commented 9 years ago
sorry I missed it. in any case I have linker error
1>c:/android/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/windo
ws-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-android
eabi/bin/ld.exe : error : Android/Debug/DroppedItemWrapper.o: requires 
unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC

Original comment by SergeySo...@gmail.com on 22 Jul 2014 at 9:09

GoogleCodeExporter commented 9 years ago
Make sure you don't have the -nostdlib flag defined for linking.
I.e. Ignore All Default Libraries = No

Original comment by craigjam...@gmail.com on 29 Aug 2014 at 9:15

GoogleCodeExporter commented 9 years ago
I hit this issue when I set the platform toolset to "ARM 4.8 Toolchain 
(arm-linux-androideabi-4.8)"

With platform toolset set as "ARM 4.6 Toolchain (arm-linux-androideabi-4.6)", 
there's no problem.

Setting Ignore "All Default Libraries = No" does make it link - but, of course, 
it makes the .so file larger.

Original comment by NosPiraa...@gmail.com on 21 Oct 2014 at 3:39

GoogleCodeExporter commented 9 years ago

Original comment by gavin.dj.pugh on 9 Feb 2015 at 8:38

GoogleCodeExporter commented 9 years ago
Is there any update on this bug? I have been running into the same while 
linking a .so file with NDK r10d.

Original comment by shri...@bluejeansnet.com on 4 Mar 2015 at 6:32

GoogleCodeExporter commented 9 years ago
I have raised a similar bug with Google android - 
http://code.google.com/p/android/issues/detail?id=158264&colspec=ID%20Type%20Sta
tus%20Owner%20Summary%20Stars

Original comment by shri...@bluejeansnet.com on 4 Mar 2015 at 6:37