[Boost-users] Please help! How to make g++ link to libboost_thread-mt.so instead of libboost_thread-mt.so.1.33.1

245 views
Skip to first unread message

Louis Chen

unread,
Mar 27, 2009, 9:39:37 AM3/27/09
to boost...@lists.boost.org, Louis Chen
Hi,
local machine(A): boost-1.33.1, suse 10.3, gcc-4.2.1
A:/home/aa # ldconfig -p | grep boost_thread
        libboost_thread-mt.so.1.33.1 (libc6) => /usr/lib/libboost_thread-mt.so.1.33.1
        libboost_thread-mt.so (libc6) => /usr/lib/libboost_thread-mt.so

remote machine(B): boost-1.34.1, fedora 10, gcc-4.3.2. And i can NOT configure B.
B:/home/bb # ldconfig -p | grep boost_thread
        libboost_thread-mt.so.3 (libc6) => /usr/lib/libboost_thread-mt.so.3
        libboost_thread-mt.so (libc6) => /usr/lib/libboost_thread-mt.so

The problem is that i compile main in A with LDFLAGS=-lboost_thread-mt. And main is linked to libboost_thread-mt.so.1.33.1.
A:~/aa> ldd main | grep boost_thread
        libboost_thread-mt.so.1.33.1 => /usr/lib/libboost_thread-mt.so.1.33.1 (0xb7ca6000)

When i try to run main in B, it fails, of course, with message: "main: error while loading shared library: libboost_thread-mt.so.1.33.1: can not open shared object file: No such file or directory."

How can i force g++ link main to libboost_thread-mt.so in A?

Thanks in advance!:)

--
Louis Chen
Southeast University, Nanjing
Email:csz...@gmail.com

Ravi

unread,
Mar 27, 2009, 4:28:21 PM3/27/09
to boost...@lists.boost.org
On Friday 27 March 2009 09:39:37 Louis Chen wrote:
> When i try to run main in B, it fails, of course, with message: "main:
> error while loading shared library: libboost_thread-mt.so.1.33.1: can not
> open shared object file: No such file or directory."
>
> How can i force g++ link main to libboost_thread-mt.so in A?

You should not do this. Boost versions are not binary compatible. In
particular, boost.thread API has changed quite dramatically in the last few
releases. If, at run time, you use a different version compared to build time,
the loader will quit stating that symbols are not matched/found.

Regards,
Ravi

_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Reply all
Reply to author
Forward
0 new messages