Yes, here it is:
thread* thread_group::create_thread(const function0<void>& threadfunc)
{
    // No scoped_lock required here since the only "shared data" that's
    // modified here occurs inside add_thread which does scoped_lock.
    std::auto_ptr<thread> thrd(new thread(threadfunc));
    add_thread(thrd.get());
    return thrd.release();
}

Is it usual that compiler generates the code that passes the allocator along with the parameter passed? (I'm total newbie this regard)

Best regards,
Damjan

2012/4/16 Vicente J. Botet Escriba <vicente.botet@wanadoo.fr>
Le 16/04/12 18:52, Damjan Zemljič a écrit :
Hi,
our code is actually a plug-in (first level) (with own plug-ins - second level) for and app created with gcc 3.4 + STLport + boost 1.33.1 (boost version which we would really like to avoid because of limited shared_ptr API). We just stepped down from the position, where cross-compiler gcc 4.2.4 and boost 1.35.0 was used for the first and second level plugins.

It is actually quite a Frankenstein (one of the second level plugins is gcc 4.2 with STL (not STLport!), but should be on safe side talking pure "C" with the rest, hopefully) and we decided to step down and reduce the risks as much as possible and hopefully get rid off some weird bugs (runtime linker does not unload the first level plugin cleanly, even though it claims it does so, which is obvious next time the plugin is loaded and link-chaos begins).

Initially, code was written for BOOST 1.34.1 (with STL, not STLport) and is widely used and thoroughly tested. And yes, I know I'm talking about very old libraries.

To go back to issue, I probably don't understand your point. 1.34.1 holds declaration in header file but no definition of it?? What I'd suspect is a naming / namespace issue with the functor allocator referenced, but this is more or less just a guess... :(

Thank you for a fast response,
Damjan

2012/4/16 Vicente Botet <vicente.botet@wanadoo.fr>

Damjan Zemljič wrote
>
> Hi,
> I'm trying to build app which uses some shared library (BMS) depending on
> boost_thread:

> usr/bin/c++   -O3 ...  -o bms_ctrl -rdynamic -L/paths...
> -lboost_thread-gcc34-mt-p-1_34_1 ...
>
> Which reports an error:
> BMS/lib/Linux-2.6/libBMS.so: undefined reference to
> `boost::thread::thread(boost::function0<void,stlp_std::allocator<boost::function_base>
>> const&)'
>
> If possible (problem is solved), we would prefer boost 1.34.1 over 1.35.0.
> Any idea / hint is very much appreciated.
>
>

Have you checked with other platform/compiler/lib?
I will try to recover the version 1.34.1 and see what could be wrong.

Well I have uploaded version 1.34.1 and the function is declared as

    explicit thread(const function0<void>& threadfunc);

and defined as

thread::thread(const function0<void>& threadfunc)
    : m_joinable(true)
{...}

and used in

thread* thread_group::create_thread(const function0<void>& threadfunc)
{
.
    std::auto_ptr<thread> thrd(new thread(threadfunc));

I don't see where is the error? Does libboost_thread-gcc34-mt-p-1_34_1.so defines thread_group::create_thread ?

Best,
Vicente





_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build