title: Android NDK undefined reference to `std::ios_base::Init::Init()'
body: <p>I'm migrating to cocos2d-x 3.17.2 from cocos2d-x 3.9 and when I build android studio project, I have errors when linking Wwise libAuroPannerMixer.a. NDK version 19.2, compile with clang, wwise version 2017.1.3.6377. Maybe someone has the same problem?</p>
  
  <p><strong>Application.mk</strong></p>
  
  <pre><code>APP_STL := c++_static
  
  APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 - 
  fsigned-char -Wno-extern-c-compat
  APP_LDFLAGS := -latomic -stdlib=libc++ -lstdc++
  
  APP_ABI := arm64-v8a
  APP_SHORT_COMMANDS := true
  
  ifeq ($(NDK_DEBUG),1)
    APP_CPPFLAGS += -DCOCOS2D_DEBUG=1
    APP_OPTIM := debug
  else
    APP_CPPFLAGS += -DNDEBUG
    APP_OPTIM := release
  endif
  </code></pre>
  
  <p><strong>build.gradle:</strong></p>
  
  <pre><code>import org.gradle.internal.os.OperatingSystem
  
  apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger()
  
      defaultConfig {
          applicationId "org.bio.brick.breaker"
          minSdkVersion PROP_MIN_SDK_VERSION
          targetSdkVersion PROP_TARGET_SDK_VERSION
          versionCode 55
          versionName "1.55"
          multiDexEnabled true
  
          externalNativeBuild {
              if (PROP_BUILD_TYPE == 'ndk-build') {
                  ndkBuild {
                      targets 'BioBrickBreaker'
                      arguments 'NDK_TOOLCHAIN_VERSION=clang'
                      arguments '-j' + Runtime.runtime.availableProcessors()
  
                      def module_paths =     [project.file("../../cocos2d").absolutePath,
                                      project.file("../../cocos2d/cocos").absolutePath,
                                      project.file("../../cocos2d/external").absolutePath]
                      if (OperatingSystem.current().isWindows()) {
                          module_paths = module_paths.collect {it.replaceAll('\\\\', '/')}
                          arguments 'NDK_MODULE_PATH=' + module_paths.join(";")
                      }
                      else {
                          arguments 'NDK_MODULE_PATH=' + module_paths.join(':')
                      }
                  }
              }
              else if (PROP_BUILD_TYPE == 'cmake') {
                  cmake {
                      targets 'BioBrickBreaker'
                      arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
                      cppFlags "-frtti -fexceptions -fsigned-char"
                  }
              }
          }
  
          ndk {
              abiFilters = []
              abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String})
          }
      }
  
      sourceSets.main {
          java.srcDir "src"
          res.srcDir "res"
          jniLibs.srcDir "libs"
          manifest.srcFile "AndroidManifest.xml"
          assets.srcDir "../../Resources"
      }
  
      externalNativeBuild {
          if (PROP_BUILD_TYPE == 'ndk-build') {
              ndkBuild {
                  path "jni/Android.mk"
              }
          }
          else if (PROP_BUILD_TYPE == 'cmake') {
              cmake {
                  path "../../CMakeLists.txt"
              }
          }
      }
  
      buildTypes {
          release {
              debuggable false
              jniDebuggable false
              renderscriptDebuggable false
              minifyEnabled true
              shrinkResources true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
              if (project.hasProperty("RELEASE_STORE_FILE")) {
                  signingConfig signingConfigs.release
              }
  
              externalNativeBuild {
                  ndkBuild {
                     arguments 'NDK_DEBUG=0'
                  }
              }
         }
  
          debug {
              debuggable true
              jniDebuggable true
              renderscriptDebuggable true
              externalNativeBuild {
                  ndkBuild {
                      arguments 'NDK_DEBUG=1'
                  }
              }
          }
      }
  }
  
  buildscript {
      repositories {
          mavenCentral()
      }
  }
  
  repositories {
      maven {
          url "https://maven.google.com"
      }
  
      maven {
          url "http://maven.gameanalytics.com/release"
      }
  
      flatDir {
          dirs 'libs-aar'
      }
  }
  
  android.applicationVariants.all { variant -&gt;
      delete "${buildDir}/intermediates/assets/${variant.dirName}"
  
      variant.mergeAssets.doLast {
          copy {
              from "${buildDir}/../../../Resources"
              into "${buildDir}/intermediates/assets/${variant.dirName}"
              exclude "**/*.gz"
          }
      }
  }
  
  dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation project(':libcocos2dx')
      implementation project(':downloader_library')
      implementation project(':license_library')
      implementation project(':zip_library')
  }
  </code></pre>
  
  <p><strong>Output log:</strong></p>
  
  <pre><code>D:/dev/biobrickbreaker/proj.android/app/jni/../../../WwiseLib/android-21_arm64-v8a/Release/lib/libAuroPannerMixer.a(AuroPannerMixer.o): In function `__static_initialization_and_destruction_0':
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x/iostream:74: undefined reference to `std::ios_base::Init::Init()'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x/iostream:74: undefined reference to `std::ios_base::Init::~Init()'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x/iostream:74: undefined reference to `std::ios_base::Init::~Init()'
  D:/dev/biobrickbreaker/proj.android/app/jni/../../../WwiseLib/android-21_arm64-v8a/Release/lib/libAuroPannerMixer.a(LSSAuroPanner.o): In function `LssAuroPannerEncoder::setSourceParameter(char const*, float)':
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:627: undefined reference to `std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::basic_string(char const*, std::allocator&lt;char&gt; const&amp;)'
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:628: undefined reference to `std::string::compare(char const*) const'
  D:/dev/biobrickbreaker/proj.android/app/jni/../../../WwiseLib/android-21_arm64-v8a/Release/lib/libAuroPannerMixer.a(LSSAuroPanner.o): In function `std::string::_Rep::_M_dispose(std::allocator&lt;char&gt; const&amp;)':
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x\bits/basic_string.h:240: undefined reference to `std::string::_Rep::_S_empty_rep_storage'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x\bits/basic_string.h:240: undefined reference to `std::string::_Rep::_S_empty_rep_storage'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x\bits/basic_string.h:240: undefined reference to `std::string::_Rep::_S_empty_rep_storage'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x\bits/basic_string.h:240: undefined reference to `std::string::_Rep::_S_empty_rep_storage'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x\bits/basic_string.h:249: undefined reference to `std::string::_Rep::_M_destroy(std::allocator&lt;char&gt; const&amp;)'
  D:/dev/biobrickbreaker/proj.android/app/jni/../../../WwiseLib/android-21_arm64-v8a/Release/lib/libAuroPannerMixer.a(LSSAuroPanner.o): In function `LssAuroPannerEncoder::setSourceParameter(char const*, float)':
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:632: undefined reference to `std::string::compare(char const*) const'
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:636: undefined reference to `std::string::compare(char const*) const'
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:640: undefined reference to `std::string::compare(char const*) const'
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:644: undefined reference to `std::string::compare(char const*) const'
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:648: undefined reference to `std::string::compare(char const*) const'
  D:/dev/biobrickbreaker/proj.android/app/jni/../../../WwiseLib/android-21_arm64-v8a/Release/lib/libAuroPannerMixer.a(LSSAuroPanner.o):C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:652: more undefined references to `std::string::compare(char const*) const' follow
  D:/dev/biobrickbreaker/proj.android/app/jni/../../../WwiseLib/android-21_arm64-v8a/Release/lib/libAuroPannerMixer.a(LSSAuroPanner.o): In function `__static_initialization_and_destruction_0':
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x/iostream:74: undefined reference to `std::ios_base::Init::Init()'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x/iostream:74: undefined reference to `std::ios_base::Init::~Init()'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x/iostream:74: undefined reference to `std::ios_base::Init::~Init()'
  clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)D:/dev/biobrickbreaker/proj.android/app/jni/../../../WwiseLib/android-21_arm64-v8a/Release/lib/libAuroPannerMixer.a(AuroPannerMixer.o): In function `__static_initialization_and_destruction_0':
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x/iostream:74: undefined reference to `std::ios_base::Init::Init()'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x/iostream:74: undefined reference to `std::ios_base::Init::~Init()'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x/iostream:74: undefined reference to `std::ios_base::Init::~Init()'
  D:/dev/biobrickbreaker/proj.android/app/jni/../../../WwiseLib/android-21_arm64-v8a/Release/lib/libAuroPannerMixer.a(LSSAuroPanner.o): In function `LssAuroPannerEncoder::setSourceParameter(char const*, float)':
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:627: undefined reference to `std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::basic_string(char const*, std::allocator&lt;char&gt; const&amp;)'
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:628: undefined reference to `std::string::compare(char const*) const'
  D:/dev/biobrickbreaker/proj.android/app/jni/../../../WwiseLib/android-21_arm64-v8a/Release/lib/libAuroPannerMixer.a(LSSAuroPanner.o): In function `std::string::_Rep::_M_dispose(std::allocator&lt;char&gt; const&amp;)':
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x\bits/basic_string.h:240: undefined reference to `std::string::_Rep::_S_empty_rep_storage'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x\bits/basic_string.h:240: undefined reference to `std::string::_Rep::_S_empty_rep_storage'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x\bits/basic_string.h:240: undefined reference to `std::string::_Rep::_S_empty_rep_storage'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x\bits/basic_string.h:240: undefined reference to `std::string::_Rep::_S_empty_rep_storage'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x\bits/basic_string.h:249: undefined reference to `std::string::_Rep::_M_destroy(std::allocator&lt;char&gt; const&amp;)'
  D:/dev/biobrickbreaker/proj.android/app/jni/../../../WwiseLib/android-21_arm64-v8a/Release/lib/libAuroPannerMixer.a(LSSAuroPanner.o): In function `LssAuroPannerEncoder::setSourceParameter(char const*, float)':
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:632: undefined reference to `std::string::compare(char const*) const'
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:636: undefined reference to `std::string::compare(char const*) const'
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:640: undefined reference to `std::string::compare(char const*) const'
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:644: undefined reference to `std::string::compare(char const*) const'
  C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:648: undefined reference to `std::string::compare(char const*) const'
  D:/dev/biobrickbreaker/proj.android/app/jni/../../../WwiseLib/android-21_arm64-v8a/Release/lib/libAuroPannerMixer.a(LSSAuroPanner.o):C:\jenkins\ws\wwise_v2017.1\wwise\Partners\Auro\AuroPanner\SoundEnginePlugin\Android/../../../auro-commons/audio/LSSAuroPanner/Src/LSSAuroPanner.cpp:652: more undefined references to `std::string::compare(char const*) const' follow
  D:/dev/biobrickbreaker/proj.android/app/jni/../../../WwiseLib/android-21_arm64-v8a/Release/lib/libAuroPannerMixer.a(LSSAuroPanner.o): In function `__static_initialization_and_destruction_0':
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x/iostream:74: undefined reference to `std::ios_base::Init::Init()'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x/iostream:74: undefined reference to `std::ios_base::Init::~Init()'
  c:\jenkins\ws\wwise_v2017.1\wwise\sdk\source\build\android\android-21_arm64-v8a\include\c++\4.9.x/iostream:74: undefined reference to `std::ios_base::Init::~Init()'
  clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>