title: Log4cpp compile error
body: <p>I have the following code which is failing to compile.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;log4cpp/Category.hh&gt;
  #include &lt;log4cpp/FileAppender.hh&gt;
  #include &lt;log4cpp/SimpleLayout.hh&gt;
  
  #define LOGFILE "./test.log"
  
  int main()
  {
      /*Setting up Appender, layout and Category*/
      log4cpp::Appender *appender = new log4cpp::FileAppender("FileAppender",LOGFILE);
      log4cpp::Layout *layout = new log4cpp::SimpleLayout();
      log4cpp::Category&amp; category = log4cpp::Category::getInstance("Category");
  
      appender-&gt;setLayout(layout);
      category.setAppender(appender);
      category.setPriority(log4cpp::Priority::INFO);
  
      /*The actual logging*/
      category.info("This is for tracing the flow");
      category.notice("This is to notify certain events");
      category.warn("This is to generate certain warnings");
  }
  </code></pre>
  
  <p>$ g++ -I/usr/local/include/log4cpp -L/usr/local/lib/ -llog4cpp -lpthread log.cc </p>
  
  <p>This compiles. But then i get the following error.</p>
  
  <pre><code>./a.out: error while loading shared libraries: liblog4cpp.so.4: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>I do see <code>liblog4cpp.so.4</code> in /usr/local/lib folder.
  How can i resolve this?</p>