title: “Undefined symbols for architecture x86_64” Xcode
body: <p>It's my first time with Xcode V11.3.1</p>
  
  <p>I'm trying to compiling Buildbox 3 project on Xcode and i got error list,
  36 error all starts with the following:</p>
  
  <pre><code>Undefined symbol:
  </code></pre>
  
  <p>and this message</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "PTAdInvoker::rewardedVideoDidReward(char const*, bool)", referenced from:
        -[AdIntegratorManager rewardedVideoDidReward:] in AdIntegratorManager.o
    "PTAdInvoker::interstitialFailed(char const*)", referenced from:
        -[AdIntegratorManager interstitialFailed:] in AdIntegratorManager.o
    "PTAdInvoker::interstitialLoaded(char const*)", referenced from:
        -[AdIntegratorManager interstitialLoaded:] in AdIntegratorManager.o
    "PTAdInvoker::rewardedVideoFailed(char const*)", referenced from:
        -[AdIntegratorManager rewardedVideoFailed:] in AdIntegratorManager.o
    "PTAdInvoker::bannerFailed(char const*)", referenced from:
        -[AdIntegratorManager bannerFailed:] in AdIntegratorManager.o
    "PTAdInvoker::rewardedVideoLoaded(char const*)", referenced from:
        -[AdIntegratorManager rewardedVideoLoaded:] in AdIntegratorManager.o
    "PTAdInvoker::bannerLoaded(char const*)", referenced from:
        -[AdIntegratorManager bannerLoaded:] in AdIntegratorManager.o
    "_AOBSendInterstitialAdAttemptReport", referenced from:
        -[AdIntegratorManager interstitialImpression:] in AdIntegratorManager.o
        -[AdIntegratorManager interstitialFailed:] in AdIntegratorManager.o
    "PTAdInvoker::networkFailed(char const*)", referenced from:
        -[AdIntegratorManager networkFailed:] in AdIntegratorManager.o
    "_AOBStartSessionReporting", referenced from:
        -[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o
    "PTModelGeneralSettings::shared()", referenced from:
        -[GameViewController shouldAutorotateToInterfaceOrientation:] in GameViewController.o
        -[GameViewController supportedInterfaceOrientations] in GameViewController.o
    "PTAdInvoker::rewardedVideoDidEnd(char const*, bool)", referenced from:
        -[AdIntegratorManager rewardedVideoDidEnd:] in AdIntegratorManager.o
    "PTPAppDelegate::~PTPAppDelegate()", referenced from:
        ___cxx_global_var_init.2 in GameViewController.o
    "cocos2d::Director::mainLoop()", referenced from:
        -[GameViewController glkView:drawInRect:] in GameViewController.o
    "PTModelController::shared()", referenced from:
        -[GameViewController viewDidLoad] in GameViewController.o
    "PTModelController::loadDataForSplashScreen(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, char const*)", referenced from:
        -[GameViewController viewDidLoad] in GameViewController.o
    "cocos2d::Director::setViewport()", referenced from:
        -[GameViewController glkView:drawInRect:] in GameViewController.o
    "cocos2d::GLViewImpl::createWithEAGLView(void*)", referenced from:
        -[GameViewController viewDidLoad] in GameViewController.o
    "cocos2d::FileUtils::addSearchPath(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, bool)", referenced from:
        -[GameViewController viewDidLoad] in GameViewController.o
    "PTPAppDelegate::PTPAppDelegate()", referenced from:
        ___cxx_global_var_init.2 in GameViewController.o
    "cocos2d::Application::run()", referenced from:
        -[GameViewController viewDidLoad] in GameViewController.o
    "cocos2d::Director::setOpenGLView(cocos2d::GLView*)", referenced from:
        -[GameViewController viewDidLoad] in GameViewController.o
    "PTAdInvoker::interstitialClosed(char const*)", referenced from:
        -[AdIntegratorManager interstitialClosed:] in AdIntegratorManager.o
    "cocos2d::Director::startAnimation()", referenced from:
        -[AppDelegate applicationDidBecomeActive:] in AppDelegate.o
    "cocos2d::FileUtils::getInstance()", referenced from:
        -[GameViewController viewDidLoad] in GameViewController.o
        cocos2d::FileUtils::sharedFileUtils() in GameViewController.o
    "cocos2d::Director::getInstance()", referenced from:
        -[AppDelegate applicationWillResignActive:] in AppDelegate.o
        -[AppDelegate applicationDidBecomeActive:] in AppDelegate.o
        -[GameViewController viewDidLoad] in GameViewController.o
        -[GameViewController glkView:drawInRect:] in GameViewController.o
        -[GameViewController touchesBegan:withEvent:] in GameViewController.o
        -[GameViewController touchesMoved:withEvent:] in GameViewController.o
        -[GameViewController touchesEnded:withEvent:] in GameViewController.o
        ...
    "cocos2d::Application::getInstance()", referenced from:
        -[AppDelegate applicationDidEnterBackground:] in AppDelegate.o
        -[AppDelegate applicationWillEnterForeground:] in AppDelegate.o
        -[GameViewController viewDidLoad] in GameViewController.o
    "PTModelController::clean()", referenced from:
        -[GameViewController viewDidLoad] in GameViewController.o
    "_AOBStopSessionReporting", referenced from:
        -[AppDelegate applicationWillTerminate:] in AppDelegate.o
    "PTBaseModelGeneralSettings::orientation() const", referenced from:
        -[GameViewController shouldAutorotateToInterfaceOrientation:] in GameViewController.o
        -[GameViewController supportedInterfaceOrientations] in GameViewController.o
    "PTAdInvoker::networkLoaded(char const*)", referenced from:
        -[AdIntegratorManager networkLoaded:] in AdIntegratorManager.o
    "cocos2d::Director::stopAnimation()", referenced from:
        -[AppDelegate applicationWillResignActive:] in AppDelegate.o
    "_AOBSendRewardedAdAttemptReport", referenced from:
        -[AdIntegratorManager rewardedVideoImpression:] in AdIntegratorManager.o
        -[AdIntegratorManager rewardedVideoFailed:] in AdIntegratorManager.o
    "_AOBSendBannerAdAttemptReport", referenced from:
        -[AdIntegratorManager bannerImpression:] in AdIntegratorManager.o
        -[AdIntegratorManager bannerFailed:] in AdIntegratorManager.o
    "PTAdInvoker::shared()", referenced from:
        -[AdIntegratorManager networkLoaded:] in AdIntegratorManager.o
        -[AdIntegratorManager networkFailed:] in AdIntegratorManager.o
        -[AdIntegratorManager bannerLoaded:] in AdIntegratorManager.o
        -[AdIntegratorManager bannerFailed:] in AdIntegratorManager.o
        -[AdIntegratorManager interstitialLoaded:] in AdIntegratorManager.o
        -[AdIntegratorManager interstitialFailed:] in AdIntegratorManager.o
        -[AdIntegratorManager interstitialClosed:] in AdIntegratorManager.o
        ...
    "_OBJC_CLASS_$_AdIntegratorInterface", referenced from:
        objc-class-ref in CustomAdIntegrator.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>and some of these error messages:</p>
  
  <pre><code>Undefined symbol: PTAdInvoker::rewardedVideoDidReward(char const*, bool)
  
  Undefined symbol: PTAdInvoker::interstitialFailed(char const*)
  
  Undefined symbol: PTAdInvoker::interstitialLoaded(char const*)
  
  Undefined symbol: PTAdInvoker::rewardedVideoFailed(char const*)
  
  Undefined symbol: PTAdInvoker::bannerFailed(char const*)
  
  Undefined symbol: PTAdInvoker::bannerFailed(char const*)
  
  Undefined symbol: PTAdInvoker::rewardedVideoLoaded(char const*)
  
  Undefined symbol: PTAdInvoker::networkFailed(char const*)
  </code></pre>
  
  <p>After a long search I found a solution  using the following</p>
  
  <p>*</p>
  
  <blockquote>
    <p>project >> Build setting >> Apple clang - Language - C++ >> Change C++
    Standard Library to libstdc++ (GNY C++ Standard Library )</p>
  </blockquote>
  
  <p>*</p>
  
  <p>it works and all above errors is gone BUT....
  I got new following error: on this code</p>
  
  <pre><code>#include &lt;stack&gt;            'stack' file not found
  #include &lt;thread&gt;
  #include &lt;chrono&gt;
  </code></pre>
  
  <p>error under <strong>"Lexical or Preprocessor issue"</strong>
  on <strong>CCDirector.h</strong> </p>
  
  <p>and when i remove " #include stack " line, i got new error:</p>
  
  <pre><code> 'thread' file not found
  </code></pre>
  
  <p>And so on.....</p>
  
  <p>Therefore, I think this solution is ineffective for me
  or can i solve <strong>'stack' file not found</strong> ???</p>
  
  <p>Thanks for any help.</p>