title: Code::Blocks is not making object files
body: <p>First of all, I am a beginner programmer so, please give simple answers that are understandable.</p>
  
  <p>I am suing Code::Blocks and I am trying to make a multiple file project in C++. I am using SDL2. My problem is that when I put all my codes and functions altogether, they run and when I seperate them, they don't. This is because the execution file requires object files to be built which it don't get. It don't get them because compiler don't form them. In other words, there are problems with linking. The compiler simply, said that there are not ".o" files. These files are in the project as "Link Files" and not "Compile Files". And when I make them "Compile Files" as well as "Link Files", they produces errors that various variables inside the file where I mentioned them, are not declared. But when I include that file in the file using the variables, it gets deeply nested.</p>
  
  <p>Following are the two ways:</p>
  
  <p>First way which is not working, with seperate files.</p>
  
  <p>In main.cpp:</p>
  
  <pre><code>    #include &lt;SDL.h&gt;
      #include &lt;other.h&gt;
  
      int var;
      int linkVar;
      int link1Var;
      int link2Var;
  
      #include "link.cpp"
      #include "link1.cpp"
      #include "link2.cpp"
  
      int main( int argc, char* args[] )
      {
        linkFunc();
        link1Func();
        link2Func();
      }
  </code></pre>
  
  <p>In link.cpp/ link1.cpp/ link2.cpp:</p>
  
  <pre><code>    void linkFunc()/void link1Func()/void link2Func() //Just a reference
      {
        //Code associated with var, link1Var, link2Var and link3Var.
      }
  </code></pre>
  
  <p>Second way which is working, with all functions in a single file.</p>
  
  <p>First thing is that I don't want to learn makefile thing. If there is any other way to solve it then be it!</p>