title: Cocos2D-X compile Linux Error: Undefined Reference
body: <p>I'm new to cocos2D-X (v 3.6), I'm using Linux to compile and run my project. When I try the following command line: </p>
  
  <pre><code>cocos compile -p linux
  </code></pre>
  
  <p>It gives me errors: </p>
  
  <pre><code>Linking CXX executable bin/MyGame
  CMakeFiles/MyGame.dir/Classes/AppDelegate.cpp.o: In function `AppDelegate::applicationDidFinishLaunching()':
  /home/caisar/MyCompany/MyGame/Classes/AppDelegate.cpp:53: undefined reference to `GraphicsScene::createScene()'
  collect2: error: ld returned 1 exit status
  make[2]: *** [bin/MyGame] Error 1
  make[1]: *** [CMakeFiles/MyGame.dir/all] Error 2
  make: *** [all] Error 2
  Error running command, return code: 2
  </code></pre>
  
  <p>This is my <code>GraphicsScene.h</code>: </p>
  
  <pre><code>#ifndef __GRAPHICS_SCENE_H__
  #define __GRAPHICS_SCENE_H__
  #include "cocos2d.h"
  
  class GraphicsScene : public cocos2d::Layer{
  public:
      static cocos2d::Scene* createScene();
      virtual bool init();
      void menuCloseCallback(cocos2d::Ref* pSender);
      CREATE_FUNC(GraphicsScene);
  };
  
  #endif
  </code></pre>
  
  <p>And this is my <code>GraphicsScene.cpp</code>:</p>
  
  <pre><code>#include "GraphicsScene.h"
  
  USING_NS_CC;
  
  Scene* GraphicsScene::createScene(){
      auto scene = Scene::create();
      auto layer = GraphicsScene::create();
      scene-&gt;addChild(layer);
  
      return scene;
  }
  
  bool GraphicsScene::init(){
      if(!Layer::init()){
          return false;
      }
  
      auto sprite = Sprite::create("autobot.png");
      sprite-&gt;setPosition(0,0);
      this-&gt;addChild(sprite, 0);
  
      return true;
  }
  
  void GraphicsScene::menuCloseCallback(Ref* pSender)
  {
      Director::getInstance()-&gt;end();
  
  #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
      exit(0);
  #endif
  }
  </code></pre>
  
  <p>Is there anything else I need to add?</p>