g++ link an .a file and its dependencies into a static .so
<p>I have a libSomelib.a that can be linked to an executable by the following command:</p>

<pre><code>g++ -L. -lsomeLib -lpcrecpp -lpcre -lpthread main.cpp -o main
</code></pre>

<p>But how could I link a shared object from it, that contains all depentencies?</p>

<p>I want to achieve the following with my new someLib.so:</p>

<pre><code>g++ -L. -lsomeLib main.cpp -o main
</code></pre>

<p>I have tried the following:</p>

<pre><code>g++ -shared -L. -lsomeLib -lpcrecpp -lpcre -lpthread -o libSomelib_static.so
</code></pre>

<p>This gives me an .so file with no symbols.</p>

<p>PS: I'm completely beginer of compilers.</p>