Skip to content

error: undefined reference to '__atomic_fetch_add_4' #1

@jinq0123

Description

@jinq0123
D:\Jinqing\android-ndk-r13b\ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=Application.mk
[armeabi] Compile++ arm  : Kcp <= LibKcp.cpp
[armeabi] Compile++ arm  : Kcp <= fec.cpp
[armeabi] Compile++ arm  : Kcp <= galois.cpp
[armeabi] Compile++ arm  : Kcp <= galois_noasm.cpp
[armeabi] Compile++ arm  : Kcp <= galois_table.cpp
[armeabi] Compile++ arm  : Kcp <= ikcp.cpp
[armeabi] Compile++ arm  : Kcp <= inversion_tree.cpp
[armeabi] Compile++ arm  : Kcp <= matrix.cpp
[armeabi] Compile++ arm  : Kcp <= reedsolomon.cpp
[armeabi] Compile++ arm  : Kcp <= sess.cpp
[armeabi] SharedLibrary  : libKcp.so
D:/Jinqing/android-ndk-r13b/build//../sources/cxx-stl/gnu-libstdc++/4.9/include\ext/atomicity.h:49: error: undefined reference to '__atomic_fetch_add_4'
D:/Jinqing/android-ndk-r13b/build//../sources/cxx-stl/gnu-libstdc++/4.9/include\ext/atomicity.h:49: error: undefined reference to '__atomic_fetch_add_4'
D:/Jinqing/android-ndk-r13b/build//../sources/cxx-stl/gnu-libstdc++/4.9/include\ext/atomicity.h:53: error: undefined reference to '__atomic_fetch_add_4'
D:/Jinqing/android-ndk-r13b/build//../sources/cxx-stl/gnu-libstdc++/4.9/include\ext/atomicity.h:53: error: undefined reference to '__atomic_fetch_add_4'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi/libKcp.so] Error 1

Add in Android.mk:

LOCAL_LDLIBS    += -latomic  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions