| View previous topic :: View next topic |
| Author |
Message |
richmastaplus Tux's lil' helper

Joined: 29 Nov 2005 Posts: 127 Location: Canada
|
Posted: Wed Apr 12, 2006 7:26 am Post subject: Boost Threading Library |
|
|
Anybody have experience coding boost threads. I don't like pthreads because they are old school c and i need something more object oriented.
My problem is I get linker errors everytime I try to use them.
Other boost classes such as boost::shared_ptr work fine and I don't need to link to anything.
Any programmers who can help me? |
|
| Back to top |
|
 |
kmj0377 Guru


Joined: 26 Sep 2003 Posts: 396
|
Posted: Wed Apr 12, 2006 11:40 am Post subject: |
|
|
| Well, most likely I think it's because you need -lboost_thread-mt |
|
| Back to top |
|
 |
xglad n00b


Joined: 13 Aug 2002 Posts: 53 Location: Ft. Lauderdale, FL, USA.
|
Posted: Wed Apr 12, 2006 12:26 pm Post subject: Re: Boost Threading Library |
|
|
| shared_ptr is a template implemented entirely in a header file. There is nothing to link. |
|
| Back to top |
|
 |
moocha Veteran

Joined: 21 Oct 2003 Posts: 5722 Location: Cluj-Napoca, Romania
|
Posted: Wed Apr 12, 2006 2:15 pm Post subject: |
|
|
It's probably a command line argument issue for the link command. Unlike most situations, the order of the object files and libraries on the linker command line is significant. _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
| Back to top |
|
 |
pgrdsl Tux's lil' helper


Joined: 29 Aug 2002 Posts: 93 Location: Southampton, UK
|
Posted: Thu Apr 13, 2006 8:38 am Post subject: Re: Boost Threading Library |
|
|
| richmastaplus wrote: | Anybody have experience coding boost threads. I don't like pthreads because they are old school c and i need something more object oriented.
My problem is I get linker errors everytime I try to use them.
Other boost classes such as boost::shared_ptr work fine and I don't need to link to anything.
Any programmers who can help me? |
The other two answers are correct: most boost libraries are header only, but some end up requiring an extra library - Boost.Thread is one of them.
(Do ls /usr/lib/libboost*.so to find out all the others.)
You will also notice the "threads" and "threadsonly" USE flags for boost - make sure you at least have "threads" enabled, otherwise you won't get the -mt versions of the library, and you obviously won't get the boost threading libraries at all. _________________ pihl |
|
| Back to top |
|
 |
|