undefined symbol in shared library
<p>I compiled a shared library in linux. After the library is generated. I execute <code>ldd -r libfoo.so</code>. It come with <strong>undefined symbol error</strong></p>

<p>my error message is as following</p>

<pre><code>ldd -r libcaffe.so
   linux-vdso.so.1 =&gt;  (0x00007fffdd541000)
   /opt/alisentry/$LIB/alisentry_connect.so =&gt;         
   /opt/alisentry/lib64/alisentry_connect.so (0x00007ff8777bc000)
   /opt/alisentry/$LIB/alisentry_exec.so =&gt;    
   /opt/alisentry/lib64/alisentry_exec.so (0x00007ff8775b8000)
   /opt/alisentry/$LIB/alisentry_kill.so =&gt; 
   ...
   libc.so.6 =&gt; /lib64/libc.so.6 (0x00007ff876291000)
   /lib64/ld-linux-x86-64.so.2 (0x0000003671800000)
undefined symbol:  
       _ZN2cv12mulSpectrumsERKNS_11_InputArrayES2_RKNS_12_OutputArrayEi
       (./libcaffe.so)
undefined symbol: _ZN2cv17getOptimalDFTSizeEi    (./libcaffe.so)
undefined symbol: _ZN2cv3dftERKNS_11_InputArrayERKNS_12_OutputArrayEii    (./libcaffe.so)
</code></pre>

<p><strong>My question is that shared library have finished the compiling and linking. Why it still have undefined symbol, Why it not happen in linking stage</strong></p>