Opened 12 years ago

Closed 10 years ago

#4921 closed Bugs (fixed)

BOOST_THREAD_USE_DLL and BOOST_THREAD_USE_LIB are crucial and need to be documented

Reported by: Jim Bell <jim@…> Owned by: viboes
Milestone: Boost 1.50.0 Component: thread
Version: Boost Development Trunk Severity: Problem
Keywords: BOOST_THREAD_USE_DLL BOOST_THREAD_USE_LIB linking Cc: jim@…, viboes

Description

Boost.Thread's documentation makes no reference to macros BOOST_THREAD_USE_DLL or BOOST_THREAD_USE_LIB, but they're crucial to correct building and linking on some platforms.

Change History (8)

comment:1 by Jim Bell <jim@…>, 12 years ago

...and they should have a line in thread's doc's table of contents.

comment:2 by anonymous, 12 years ago

In general boost is terrible for this sort of thing. The only way to learn about this kind of stuff is to get some some sort of cryptic error message when you try to compile your app, and then search for the compiler error in google.

comment:3 by Jim Bell <jim@…>, 12 years ago

Cc: jim@… added
Milestone: Boost 1.46.0Boost 1.47.0
Version: Boost 1.45.0Boost Development Trunk

comment:4 by Jim Bell <jim@…>, 12 years ago

And (for the sake of the search engines) needing it and not supplying it gives you errors like such:

undefined reference to `_imp___ZN5boost11this_thread18interruptible_waitEPvNS_6detail7timeoutE'
In function `~thread_group':
undefined reference to `_imp___ZN5boost6threadD1Ev'
undefined reference to `_imp___ZN5boost6thread4joinEv'
In function `thread<void (*)()>':
undefined reference to `_imp___ZN5boost6thread12start_threadEv'
In function `~auto_ptr':
undefined reference to `_imp___ZN5boost6threadD1Ev'
collect2: ld returned 1 exit status

comment:5 by viboes, 11 years ago

Cc: viboes added
Milestone: Boost 1.47.0To Be Determined
Owner: changed from Anthony Williams to viboes
Status: newassigned

I see that in addition Boost.Thread doesn't follows completely Automatic library selection.

It would be great to adopt the already documented way to build and use a library, document it and make the necessary adaptations on the code and bjam files.

What about this text.

Using and building the library

Boost.Thread is configured following the conventions used to build libraries with separate source code. Boost.Thread will import/export the code only if the user has specifically asked for it, by defining either BOOST_ALL_DYN_LINK if they want all boost libraries to be dynamically linked, or BOOST_THREAD_DYN_LINK if they want just this one to be dynamically liked.

The source code compiled when building the library defines a macros BOOST_THREAD_SOURCE that is used to import or export it. The user must not define this macro in any case.

Last edited 11 years ago by viboes (previous) (diff)

comment:6 by viboes, 11 years ago

Milestone: To Be DeterminedBoost 1.49.0

Committed in trunk revision #75905.

comment:7 by viboes, 11 years ago

Committed in trunk at revision [76543].

comment:8 by viboes, 10 years ago

Milestone: Boost 1.49.0Boost 1.50.0
Resolution: fixed
Status: assignedclosed

Committed in release branch at [78543]

Note: See TracTickets for help on using tickets.