Boost logo

Boost :

From: Neal D. Becker (nbecker_at_[hidden])
Date: 2003-03-31 07:37:02


Here is some more on this problem. Perhaps someone on this list has some
ideas where to look? Defining BOOST_NO_THREAD (or whatever it was) will
"fix" the problem, but I suspect it's not the correct fix. The code will
link OK dynamically, but not statically. That's strange.

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=87491

jakub_at_[hidden] changed:

           What |Removed |Added
----------------------------------------------------------------------------
             Status|NEW |NEEDINFO

------- Additional Comments From jakub_at_[hidden] 2003-03-28 13:26 -------
That looks like boost is broken (or whatever uses pthread_* functions without
making them #pragma weak and using only conditionally (as does e.g.
 libstdc++). Can you find out what exactly uses them without making them
 weak?

On Friday 28 March 2003 08:09 am, Neal D. Becker wrote:
> I just installed boost_1_30_0 and updated to glibc-2.3.2 on my RH8.0 Linux
> box. Now I have problems to create a static link of my executable.
>
> I'm wondering what is the correct link procedure.
>
> g++ -Wall -I ../../src/fixed -I ../../src/float -O3 -ffast-math
> -fstrict-aliasing -m3dnow -ggdb -march=athlon-xp -mcpu=athlon-xp
> -fprofile-arcs -D_GNU_SOURCE -Wp,-MMD,.d/Test34.d -o Test34 Test34.o -L.
> -liTest -lpopt -lcephes -lfftw -static
> Test34.o: In function
> `boost::detail::shared_count::shared_count[in-charge]<std::basic_ofstream<c
>har, std::char_traits<char> >*,
> boost::checked_deleter<std::basic_ofstream<char, std::char_traits<char> > >
> >(std::basic_ofstream<char, std::char_traits<char>
>
> >*, boost::checked_deleter<std::basic_ofstream<char, std::char_traits<char>
> > > )':
>
> /usr/include/c++/3.2/iostream:62: undefined reference to
> `pthread_mutex_init' Test34.o: In function
> `boost::detail::sp_counted_base_impl<std::basic_ofstream<char,
> std::char_traits<char> >*, boost::checked_deleter<std::basic_ofstream<char,
> std::char_traits<char> > > >::~sp_counted_base_impl [in-charge]()':
> /usr/include/c++/3.2/iostream:62: undefined reference to
> `pthread_mutex_destroy'
> Test34.o: In function
> `boost::detail::sp_counted_base_impl<std::basic_ofstream<char,
> std::char_traits<char> >*, boost::checked_deleter<std::basic_ofstream<char,
> std::char_traits<char> > > >::~sp_counted_base_impl [in-charge
> deleting]()': /usr/include/c++/3.2/iostream:62: undefined reference to
> `pthread_mutex_destroy'
> Test34.o: In function `boost::detail::sp_counted_base::~sp_counted_base
> [in-charge]()':
> /usr/include/c++/3.2/iostream:62: undefined reference to
> `pthread_mutex_destroy'
> Test34.o: In function `boost::detail::sp_counted_base::~sp_counted_base
> [in-charge deleting]()':
> /usr/include/c++/3.2/iostream:62: undefined reference to
> `pthread_mutex_destroy'
> collect2: ld returned 1 exit status
>
> It seems adding -lpthread fixes this, but 1) I don't use thread 2) it isn't
> needed for normal (nonstatic) link, and wasn't needed before the updates.
>
> Now I see I have /usr/lib/libboost_thread.so.xxx
>
> What is it for?
>
> nm /usr/lib/libboost_thread.so.1.30.0
> nm: /usr/lib/libboost_thread.so.1.30.0: no symbols
>
> Is it just used to pull in -lpthread?
>
> Apparantly, the pthread is needed because I used a boost shared pointer.
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk