title: I want to link as WINDOWS instead of CONSOLE : LNK 2019 and LNK 1120
body: <p>I'm learning DirectX11 with '3D Game Programming with Direct3D 11.0', and I got trouble. At Chapter 4, example source doesn't run. I don't know why this is happening, and how to fix it.</p>
  
  <ul>
  <li>I'm using UNICODE.</li>
  <li>At Linker -> System, WINDOWS. At C/C++ -> PreProcessor, WINDOWS.</li>
  <li>At Linker -> Advanced, Entry Point is blank.</li>
  </ul>
  
  <p>This is Source code.</p>
  
  <pre><code>#include "d3dApp.h"
  #include &lt;Windows.h&gt;
  
  class InitDirect3DApp : public D3DApp
  {
  public:
      InitDirect3DApp(HINSTANCE hInstance);
      ~InitDirect3DApp();
  
      bool Init();
      void OnResize();
      void UpdateScene(float dt);
      void DrawScene(); 
  };
  
  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance,
                     PSTR cmdLine, int showCmd)
  {
      // Enable run-time memory check for debug builds.
  #if defined(DEBUG) | defined(_DEBUG)
      _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
  #endif
  
      InitDirect3DApp theApp(hInstance);
  
      if( !theApp.Init() )
          return 0;
  
      return theApp.Run();
  }
  
  InitDirect3DApp::InitDirect3DApp(HINSTANCE hInstance)
  : D3DApp(hInstance) 
  {
  }
  
  InitDirect3DApp::~InitDirect3DApp()
  {
  }
  
  bool InitDirect3DApp::Init()
  {
      if(!D3DApp::Init())
          return false;
  
      return true;
  }
  
  void InitDirect3DApp::OnResize()
  {
      D3DApp::OnResize();
  }
  
  void InitDirect3DApp::UpdateScene(float dt)
  {
  
  }
  
  void InitDirect3DApp::DrawScene()
  {
      assert(md3dImmediateContext);
      assert(mSwapChain);
  
      md3dImmediateContext-&gt;ClearRenderTargetView(mRenderTargetView, reinterpret_cast&lt;const float*&gt;(&amp;Colors::Blue));
      md3dImmediateContext-&gt;ClearDepthStencilView(mDepthStencilView, D3D11_CLEAR_DEPTH|D3D11_CLEAR_STENCIL, 1.0f, 0);
  
      HR(mSwapChain-&gt;Present(0, 0));
  }
  </code></pre>
  
  <p>This is error message.</p>
  
  <pre><code>error LNK2019 : unresolved external symbol _main referenced in function ___tmainCRTStartup
  fatal error LNK1120 : 1 unresolved externals
  </code></pre>
  
  <p>I tried <code>int main () {}</code> at the bottom of the code, and it run. But there's no window.</p>
  
  <p>My setting's are WINDOWS, but it run as CONSOLE. I don't know why.</p>
  
  <p>I'm waiting for your answer. Have a good day :)</p>