title: LNK2019 unresolved external __declspec(dllimport) SDL_main
body: <p>I am working on making a game engine. The engine is dll project. Right now the engine builds to a dll and lib. I am trying to test what I have so far with with another project. This is the error messages that I get:</p>
  
  <pre><code>error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Aria::GameConfig::GameConfig(class std::basic_string&lt;wchar_t,struct std::char_traits&lt;wchar_t&gt;,class std::allocator&lt;wchar_t&gt; &gt; const &amp;)" (__imp_??0GameConfig@Aria@@QAE@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) referenced in function "int __cdecl SDL_main(void)" (?SDL_main@@YAHXZ)    D:\My Documents\Programing\Repo\NDTD\NDTD\Project\Main.obj
  error LNK2019: unresolved external symbol "public: __thiscall TestGame::TestGame(class Aria::GameConfig *)" (??0TestGame@@QAE@PAVGameConfig@Aria@@@Z) referenced in function "int __cdecl SDL_main(void)" (?SDL_main@@YAHXZ)    D:\My Documents\Programing\Repo\NDTD\NDTD\Project\Main.obj
  error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup   D:\My Documents\Programing\Repo\NDTD\NDTD\Project\MSVCRTD.lib(crtexe.obj)
  </code></pre>
  
  <p>Here part of my platform.h file that has the dll import and export macros</p>
  
  <pre><code>#if !defined(ARIA_STATIC)
      #ifdef ARIA_SYS_WINDOWS
          #if defined (ARIA_NONCLIENT_BUILD)
              // define dllexport and dllimport macros
              #ifndef ARIA_API
                  #define ARIA_API __declspec(dllexport)
              #endif
          #else
              #ifndef ARIA_API
                  #define ARIA_API __declspec(dllimport)
              #endif
          #endif
  
          // Visual c++ compiler warning C4251 disable
          #ifdef _MSC_VER
              #pragma warning(disable : 4251)
          #endif
  
      #else // Linux and MAC OS X
          #if __GNUC__ &gt;= 4
              // GCC 4 has unique keywords for showing/hiding symbols
              // the same keyword is used for both import and export
              #define ARIA_API __attribute__ ((__visibility__("default")))
              #define ARIA_API __attribute__ ((__visibility__("default")))
          #else
              #define ARIA_API
              #define ARIA_API
          #endif
      #endif
  #else
      // static build doesn't need import/export macros
      #define ARIA_API
      #define ARIA_API
  #endif
  </code></pre>
  
  <p>In I have built the engine with the preprocessor definition <code>ARIA_NONCLIENT_BUILD</code> and <code>UNICODE</code> and windows it defined. I have linked to SDL lib and included the header files. I am also using unicode strings with wchar. I also have not forgotten to add the ARIA_API macro in class definitions.</p>
  
  <p>In the test project here is the main.cpp file</p>
  
  <pre><code>#include &lt;Game\Game.h&gt;
  
  using namespace Aria;
  
  class TestGame : public IGame
  {
  public:
      TestGame(GameConfig* config);
      ~TestGame();
  
      void OnStartUp()        override;
      void OnUpdate(float dt) override;
      void OnRender(float dt) override;
      void OnShutdown()       override;
  };
  
  void TestGame::OnStartUp()
  {
  }
  void TestGame::OnUpdate(float dt)
  {
  }    
  void TestGame::OnRender(float dt)
  {
  }    
  void TestGame::OnShutdown()
  {   
  }    
  int main()
  {
      GameConfig* config = new GameConfig(ATEXT("test.config"));
      TestGame* game = new TestGame(config);
      return game-&gt;Run();
  }
  </code></pre>
  
  <p>If I have forgot something then let me know.</p>