cocos2dx 3.17.2
android studio 3.4.1
NDK 20
CMAKE 方式连接
使用的 AnySDK_Framework_Lua(Android) -> protocols_c++_static 里面的代码和库
连接命令
cmake {
arguments “-DCMAKE_FIND_ROOT_PATH=”, “-DANDROID_STL=c++_static”,"-DANDROID_TOOLCHAIN=clang", “-DANDROID_ARM_NEON=TRUE”
cppFlags “-frtti -fexceptions -fsigned-char -Istdc++”
}
编译的时候 提示这些东西
E:\GameProject\XXX\frameworks\runtime-src\Classes\AnySDK/anysdkbindings.cpp:225: error: undefined reference to ‘anysdk::framework::AgentManager::init(std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >)’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/ios:668: error: undefined reference to ‘std::__1::ios_base::init(void*)’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:371: error: undefined reference to ‘std::__1::locale::locale()’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to ‘std::__1::locale::~locale()’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/iosfwd:126: error: undefined reference to ‘std::__1::ios_base::~ios_base()’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to ‘std::__1::locale::~locale()’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/iosfwd:126: error: undefined reference to ‘std::__1::ios_base::~ios_base()’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to ‘std::__1::locale::~locale()’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/istream:1624: error: undefined reference to ‘std::__1::ios_base::__set_badbit_and_consider_rethrow()’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to ‘std::__1::ios_base::clear(unsigned int)’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/streambuf:220: error: undefined reference to ‘std::__1::locale::~locale()’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/iosfwd:126: error: undefined reference to ‘std::__1::ios_base::~ios_base()’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to ‘std::__1::ios_base::clear(unsigned int)’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/istream:275: error: undefined reference to ‘std::__1::ios_base::getloc() const’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to ‘std::__1::locale::use_facet(std::__1::locale::id&) const’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to ‘std::__1::ios_base::clear(unsigned int)’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/istream:288: error: undefined reference to ‘std::__1::ctype::id’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/ios:524: error: undefined reference to ‘std::__1::ios_base::clear(unsigned int)’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:973: error: undefined reference to ‘std::__1::ios_base::__set_badbit_and_consider_rethrow()’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/istream:322: error: undefined reference to ‘std::__1::ios_base::~ios_base()’
…/…/…/…/…/…/Classes/AnySDK/AnySDKlib/armeabi-v7a/libPluginProtocolStatic.a(AgentManager.o):jni/…/…/platform/android/AgentManager.cpp:typeinfo for std::__1::basic_ios<char, std::__1::char_traits >: error: undefined reference to ‘typeinfo for std::__1::ios_base’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/ios:734: error: undefined reference to ‘std::__1::ios_base::getloc() const’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:174: error: undefined reference to ‘std::__1::locale::use_facet(std::__1::locale::id&) const’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:757: error: undefined reference to ‘std::__1::ios_base::__set_badbit_and_consider_rethrow()’
/Users/chukong/Developer/mac-android-ndk-r10c/sources/cxx-stl/llvm-libc++/libcxx/include/ostream:761: error: undefined reference to ‘std::__1::ctype::id’
E:\GameProject\XXX\frameworks\runtime-src\Classes\AnySDK/anysdk_manual_bindings.cpp:1133: error: undefined reference to ‘anysdk::framework::PluginParam::PluginParam(std::__ndk1::map<std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator >, std::__ndk1::less<std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > >, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator > > > >)’
clang++: error: linker command failed with exit code 1 (use -v to see invocation)