title: How to clean up C++ compiler commands?
body: <p>I tried searching for a question like this as best as I could, but I simply don't know how exactly to ask the question. I apologize if this has been answered before, or if it is a trivial question. I am new to the large (and quite intimidating!) world of C++. I will try my best in the future. </p>
  
  <p>Let me try to explain what I mean:</p>
  
  <p>I am on Linux Ubuntu 14.04. On Ubuntu, to compile a C++ program I wrote, for example, let's say some file myProgram.cpp, I cd to its directory and type the following into the terminal:</p>
  
  <pre><code>g++ myProgram.cpp -o myProgram
  </code></pre>
  
  <p>This way, I can then type:</p>
  
  <pre><code>./myProgram
  </code></pre>
  
  <p>To run myProgram. This was simple and satisfactory -- and I learned this from reading the C++ Primer. After finding myself comfortable coding in C++, I decided to move onto giving myself a project, which involved using Image Magick, specifically, its C++ API: Magick++. However, now, if I wish to compile something, I have to type this ugly mess:</p>
  
  <pre><code>g++ `Magick++-config --cxxflags --cppflags` -o testMagick testMagick.cpp `Magick++-config --ldflags --libs`
  </code></pre>
  
  <p>To make my code compile and execute. This seems very messy, and when I was trying to see if CImg was any better, it turned out that it needed its own set of arguments like <code>-lm</code>, <code>-lpthread</code> and <code>-lX11</code>. It also turned out that to compile with C++11, I had to write <code>-std=c++0x</code>. So my question is:</p>
  
  <p>Is there a way to simplify/clean up my compile statements in the terminal, or do I have to find out and use a specific set of arguments whenever I compile a different kind of program using a different API?</p>