Hi, i'm trying to build (well, link) TGUI version 0.8 for Android but i'm having a bit of trouble.
I'm on Windows 10 and using GCC-6.3.0-1.
I already compiled SFML for Android with success, using the armeab-v7a ABI architecture and the example application is working fine.
I used the tutorial they have on Github (https://github.com/SFML/SFML/wiki/Tutorial%3A-Building-SFML-for-Android).
I also used the NDK r17c since it wasn't working with r18b, and SFML is in the /third_party folder as it should be.
So, everything is set up (I followed your tutorial) and I used cmake:
I shortened the ndk path but I used a good and working one. Everything is still fine, so I build TGUI.
And that's the error, the .dll used when linking have "invalid character", but the .dll are working and I am using them, I also compiled them myself using the same compiler.
Am I supposed to build SFML with the same toolchain as the one used by the NDK, or do I need to pass the toolchain I used ?
Also, is the linker supposed to use the lib build for Windows and not those build for Android (in the ndk folder) ?
Thanks.
I'm on Windows 10 and using GCC-6.3.0-1.
I already compiled SFML for Android with success, using the armeab-v7a ABI architecture and the example application is working fine.
I used the tutorial they have on Github (https://github.com/SFML/SFML/wiki/Tutorial%3A-Building-SFML-for-Android).
I also used the NDK r17c since it wasn't working with r18b, and SFML is in the /third_party folder as it should be.
So, everything is set up (I followed your tutorial) and I used cmake:
Code Select
cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=/ndk -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=Debug .. -G "MinGW Makefiles"
-- Android: Targeting API '28' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a'
-- Android: Selected GCC toolchain 'arm-linux-androideabi-4.9'
-- The C compiler identification is GNU 4.9.0
-- The CXX compiler identification is GNU 4.9.0
-- Check for working C compiler: /ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe
-- Check for working C compiler: /ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++.exe
-- Check for working CXX compiler: /ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SFML 2.5.0 in C:/SFML/lib/cmake/SFML
-- Configuring done
-- Generating done
-- Build files have been written to: /TGUI/armeabi-v7a
I shortened the ndk path but I used a good and working one. Everything is still fine, so I build TGUI.
Code Select
mingw32-make
... everything compile ...
[97%] Linking CXX shared library ..\..\lib\libtgui-d.so
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-graphics-d-2.dll:1:3: invalid character
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-graphics-d-2.dll:1:3: syntax error, unexpected $end
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-graphics-d-2.dll: not an object or archive
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-window-d-2.dll:1:3: invalid character
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-window-d-2.dll:1:3: syntax error, unexpected $end
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-window-d-2.dll: not an object or archive
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-system-d-2.dll:1:3: invalid character
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-system-d-2.dll:1:3: syntax error, unexpected $end
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-system-d-2.dll: not an object or archive
collect2.exe: error: ld returned 1 exit status
src\TGUI\CMakeFiles\tgui.dir\build.make:2176: recipe for target 'lib/libtgui-d.so' failed
mingw32-make[2]: *** [lib/libtgui-d.so] Error 1
CMakeFiles\Makefile2:86: recipe for target 'src/TGUI/CMakeFiles/tgui.dir/all' failed
mingw32-make[1]: *** [src/TGUI/CMakeFiles/tgui.dir/all] Error 2
Makefile:128: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
And that's the error, the .dll used when linking have "invalid character", but the .dll are working and I am using them, I also compiled them myself using the same compiler.
Am I supposed to build SFML with the same toolchain as the one used by the NDK, or do I need to pass the toolchain I used ?
Also, is the linker supposed to use the lib build for Windows and not those build for Android (in the ndk folder) ?
Thanks.