Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Build with arm64-v8a and link in CMAKE  (Read 4254 times)

0 Members and 1 Guest are viewing this topic.

JeromeChen

  • Newbie
  • *
  • Posts: 3
    • View Profile
Build with arm64-v8a and link in CMAKE
« on: April 30, 2020, 05:17:27 pm »
I know that SFML currently doesn't support arm64-v8a, but my programe have already included some thirdparty api with arm64-v8a veriosn.

Therefore, I tried to rebuild sfml arm64-v8a veriosn.

I found some pre-built arm64-v8a like libfreetype.a and libopenal.so then I put them at SFML-2.5.1\extlibs\libs-android\arm64-v8a\

Moreover, I don't need the audio modlue in SFML so I deleted audio modlue inculding in CmakeLists.

Build Command:
cmake -G "MinGW Makefiles" -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DANDROID_STL=c++_static -DCMAKE_ANDROID_API=24 -DCMAKE_SYSTEM_NAME=Android -DCMAKE_BUILD_TYPE=Release ../..

Finally it built successfully and I included these .so file in CmakeLists.
Like these:
        add_library(libsfml-graphics SHARED IMPORTED)
        set_target_properties(  
                libsfml-graphics
                PROPERTIES IMPORTED_LOCATION
                ${IIIVSLAM_LIB_DIR}/SFML/libs/arm64-v8a/libsfml-graphics.so
                )
        target_link_libraries(
                libsfml-graphics
        )      

It was built successfully without any errors, but when I was running the program, it crashed directly.
Does anyone have relevant experience or know which step of mine is wrong?

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: Build with arm64-v8a and link in CMAKE
« Reply #1 on: May 03, 2020, 02:17:10 pm »
What error messages do you get in the logcat output when running your app?

Which android ndk version do you use?

Unzip the .apk and check if the shared libraries (.so files) are included under libs/abi/

JeromeChen

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Build with arm64-v8a and link in CMAKE
« Reply #2 on: May 04, 2020, 03:20:39 pm »
Thanks for your reply!!
with your question:

error message :

android ndk version : r16b

I make sure these shared libraries are included under lib/arm64-v8a

I still don’t know which step is wrong, hope you can help me thanks!!

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: Build with arm64-v8a and link in CMAKE
« Reply #3 on: May 04, 2020, 07:25:44 pm »
I am not familiar to the firebase stuff (crashlytics), but the error message does not really give any information abrout the crash, apart from it being a SEGFAULT (nullptr access).

Have you tried a debug build and launching the application with the debugger? This should give you more information about where the crash is happening.

JeromeChen

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Build with arm64-v8a and link in CMAKE
« Reply #4 on: May 05, 2020, 04:23:40 pm »
I tried using the debug version, but found that when initializing sfml parameter, it will crash.

I think it maybe that the way I built is wrong

 

anything