<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<span class="Apple-style-span" style="color: rgb(0, 0, 0);
font-family: 'Times New Roman'; font-style: normal; font-variant:
normal; font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; -webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); font-size: medium; ">
<pre style="white-space: pre-wrap; ">I accidentally send below message only to David, repostion to groups.</pre>
</span>
<pre><tt>On 01.07.2011 19:57, David Boddie wrote:
> On Wed Jun 29 10:38:07 BST 2011, Jarosław Białas wrote:
>
>> Recently I tried to use my c++ library in Python using SIP.
>> In SIP configuration file I added some extra libraries like QtGui,fftw3
>> and ssl.
>> Compilation and linking pass without any warnings or errors:
>>
>> g++ -c -pipe -fPIC -O2 -Wall -W -DNDEBUG -I. -I/usr/include/python2.7 -o
>> sipmd5testcmodule.o sipmd5testcmodule.cpp
>> g++ -c -pipe -fPIC -O2 -Wall -W -DNDEBUG -I. -I/usr/include/python2.7 -o
>> sipmd5testmd5test.o sipmd5testmd5test.cpp
>> g++ -c -pipe -fPIC -O2 -Wall -W -DNDEBUG -I. -I/usr/include/python2.7 -o
>> md5test.o md5test.cpp
>> g++ -Wl,--hash-style=gnu -Wl,--as-needed -shared
>> -Wl,--version-script=md5test.exp -o md5test.so sipmd5testcmodule.o
>> sipmd5testmd5test.o md5test.o -lssl
>>
>> But when I try to import library:
>> ImportError: ./md5test.so: undefined symbol: MD5
>
> It seems to me that your use of the MD5 function isn't resolved at run-time.
> Since you're building a library, the linker doesn't care because it expects
> that it will find that symbol later.
>
>> When I compiled my code and included it in c++ all worked fine.
>
> When you run ldd on the md5test.so file, what do you get as output? I get
> this:
>
> $ ldd md5test.so
> libssl.so.0.9.8 => /usr/lib/i686/cmov/libssl.so.0.9.8 (0xb776f000)
> libstdc++.so.6 => /usr/local/lib/libstdc++.so.6 (0xb7684000)
> libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb765e000)
> libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 (0xb7640000)
> libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb74f1000)
> libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8
> (0xb73af000)
> libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb73ab000)
> libz.so.1 => /usr/lib/libz.so.1 (0xb7396000)
> /lib/ld-linux.so.2 (0xb77d2000)
>
> If the first line in your output indicates that libssl.so cannot be found
> then you may need to update your build file to add a suitable library path
> for that library.
>
> David
> _______________________________________________
> PyQt mailing list <a class="moz-txt-link-abbreviated" href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a>
> <a class="moz-txt-link-freetext" href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a>
I have done everything like you do, but instead of that I get:
$ ldd md5test.so
linux-vdso.so.1 => (0x00007ffffe7cd000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fa458142000)
libc.so.6 => /lib/libc.so.6 (0x00007fa457de1000)
libm.so.6 => /lib/libm.so.6 (0x00007fa457b5e000)
/lib/ld-linux-x86-64.so.2 (0x00007fa45867b000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fa457948000)
When I tried:
$ g++ -fPIC -shared md5test.cpp -o md5test.so -lssl
$ ldd md5test.so
linux-vdso.so.1 => (0x00007fffad5ff000)
libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x00007ff7cc347000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007ff7cc03d000)
libm.so.6 => /lib/libm.so.6 (0x00007ff7cbdba000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007ff7cbba4000)
libc.so.6 => /lib/libc.so.6 (0x00007ff7cb843000)
libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007ff7cb486000)
libdl.so.2 => /lib/libdl.so.2 (0x00007ff7cb282000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007ff7cb06a000)
/lib/ld-linux-x86-64.so.2 (0x00007ff7cc7d1000)
Then I realized that libcrypto is also linked to shared library.
I add crypto to configuration file and despite the fact that libssl is
still missing(I really don't know why), libcrypto is present.
Finally I imported md5test successfully.
Thank you for helping me again.
</tt></pre>
</body>
</html>