title: How to create a dynamic library for c++ on linux?
body: <p>I would like to create a dynamic library for c++ program on linux.
  In c++ program/system I`m using libconfig++ library, libpqxx library, some boost and c++11.</p>
  
  <p>My steps:
  1)</p>
  
  <pre><code>g++ -Wall -I/usr/local/include/ -std=c++0x -lconfig++ -Wall -lpqxx -lpq -fPIC -c ../SourceFiles/DBHandler.cpp ../SourceFiles/ParamServer.cpp ../SourceFiles/Functions.cpp
  </code></pre>
  
  <p>2)</p>
  
  <pre><code>g++ -shared -Wl,-soname,libctest.so.1 -o libctest.so.1.0   *.o
  </code></pre>
  
  <p>3)</p>
  
  <pre><code>ln -sf libctest.so.1.0 libctest.so.1
  </code></pre>
  
  <p>4)</p>
  
  <pre><code>ln -sf libctest.so.1.0 libctest.so
  </code></pre>
  
  <p>5) compile</p>
  
  <pre><code>g++ -Wall -I/path/to/include-files -L/path/to/libraries program.cpp -I/usr/local/include/ -std=c++0x -lconfig++ -lpqxx -lpq -lctest -o prog
  </code></pre>
  
  <p>After execute above command :</p>
  
  <pre><code>/usr/bin/ld: cannot find -lctest
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>Here is the reference:
  <a href="http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html" rel="nofollow">enter link description here</a></p>