title: C++ using only h files?
body: <p>can I program in <a href="https://stackoverflow.com/questions/tagged/c%2b%2b"><code>c++</code></a> by just using header files?</p>
  
  <p>I keep trying to do it but getting a problem with this file here..
  it keeps saying things like:</p>
  
  <blockquote>
    <p>Severity  Code    Description Project File    Line    Suppression State
    Error LNK2001 unresolved external symbol "private: static int
    Engine::frameDelay"
    (?frameDelay@Engine@@0HA) Engine  C:\Users\Shadowblitz16\Documents\Visual
    Studio 2017\Projects\Zelda Classic 3.0\Zelda Classic 3.0\Test.obj 1</p>
  </blockquote>
  
  <p><strong>Code</strong>:</p>
  
  <pre><code>#pragma once
  #include "SDL.h"
  #include "SDL_image.h"
  #include &lt;iostream&gt;
  
  class Engine
  {
      private:
          static int frameTime;
          static int frameStart;
          static int frameDelay;
          static bool running;
          static SDL_Window   *window;
          static SDL_Renderer *renderer;
  
          static void HandleLoop()
          {
              while (running)              //Loop
              {
                  //Start frame
                  frameStart = SDL_GetTicks();
                  HandleUpdate();
                  HandleRender();
  
                  //End frame 
                  frameTime = SDL_GetTicks() - frameStart;
                  if (frameDelay &gt; frameTime) SDL_Delay(frameDelay - frameTime);
              }
          };
          static void HandleUpdate()
          {
              SDL_Event event;
              SDL_PollEvent(&amp;event);
              switch (event.type)
              {
              case SDL_QUIT: running = false; break;
              default: break;
              }
              Update();
          };
          static void HandleRender()
          {
              SDL_RenderClear(renderer);
              Render();
              SDL_RenderPresent(renderer);
          }
  
      public:
          static void Run(const char* title, int x, int y, int width, int height, bool fullscreen)
          {
              frameTime  = 0;
              frameStart = 0;
              frameDelay = 0;
  
              window     = nullptr;
              renderer   = nullptr;
  
              running = false;
  
              if (SDL_Init(SDL_INIT_EVERYTHING) == 0)
              {
                  std::cout &lt;&lt; "SDL Initalized!..." &lt;&lt; std::endl;
                  window = SDL_CreateWindow(title, x, y, width, height, (fullscreen == true ? SDL_WINDOW_FULLSCREEN : 0));
                  if (window) std::cout &lt;&lt; "Window Created!" &lt;&lt; std::endl;
  
                  renderer = SDL_CreateRenderer(window, -1, 0);
                  if (renderer) std::cout &lt;&lt; "Renderer Created!" &lt;&lt; std::endl;
  
                  SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
                  running = true;
              }
  
              frameStart = SDL_GetTicks(); //Get this so we can use it in the create event
              Create();                    //Run create event
  
              Clean();                     //Run clean event
              SDL_Quit();                  //Quit
          };
  
          static void Create() {};
          static void Update() {};
          static void Render() {};
          static void Clean()  {};
  
          static bool Running()              { return running;  };
          static SDL_Window*   GetWindow()   { return window;   };
          static SDL_Renderer* GetRenderer() { return renderer; };
  };
  </code></pre>
  
  <p>I think that its easier to read and debug this way, hopefully this is possiable</p>