title: Where do I place cpp file when header is in /usr/local/include?
body: <p>I wrote a c++ class(files <code>class.h</code> and <code>class.cpp</code>) that I want to use in a c++ application <code>app.cpp</code> from multiple directories on my linux system. Therefore, I moved the <code>class.h</code> and <code>class.cpp</code> files to <code>/usr/local/include/</code>. I tried to compile <code>app.cpp</code> using <code>g++ -o app app.cpp</code> which results in an <code>undefined reference</code> error(probably since g++ does not find the <code>class.cpp</code> file).</p>
  <p>I figured out that I can fix this error by either writing the content of <code>class.cpp</code> directly into <code>class.h</code> or by explicitly specifying the location of <code>class.cpp</code> with the extended command <code>g++ -o app app.cpp /usr/local/include/class.cpp</code>. Obviously, both solutions are not satisfactory.</p>
  <p>Presumably, someone who does this stuff more regularly(I'm not an computer science student) can give me a quick solution to my problem. Therefore, I ask now instead of investing more hours into searching the web.</p>