cv_state has not been declared

Hi, I'm tring to include boost/thread/mutex.hpp, but when I do compiling, there is an error message: cv_state has not been declared. What's the problem? how should I solve it? Suggestion would be appreciated, thanks! -- ------------------------------- Enjoy life! Barco You

Barco You <barcojie <at> gmail.com> writes:
I'm tring to include boost/thread/mutex.hpp, but when I do compiling, there is an error message: cv_state has not been declared. What's the problem? how should I solve it?
Which platform are you on, which compiler are you using, and which version of boost? Anthony

I'm trying to compile boost.1_38_1 in Cygwin with GCC4.2.2, thanks! On 11/29/07, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
Barco You <barcojie <at> gmail.com> writes:
I'm tring to include boost/thread/mutex.hpp, but when I do compiling, there is an error message: cv_state has not been declared. What's the problem? how should I solve it?
Which platform are you on, which compiler are you using, and which version of boost?
Anthony
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- ------------------------------- Enjoy life! Barco You

"Barco You" <barcojie@gmail.com> writes:
I'm trying to compile boost.1_38_1 in Cygwin with GCC4.2.2, thanks!
That's not a valid boost version number. Do you mean 1.28.1 or 1.33.1 or 1.34.1? Are you compiling with the appropriate threading option (-pthread, -mthread, or whatever --- check your gcc docs)? Anthony -- Anthony Williams Just Software Solutions Ltd - http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

Sorry, it's 1.34.1 :) what does -pthread mean? it means libpthread linked, why doesn't it be -lpthread? thanks! On 11/30/07, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Barco You" <barcojie@gmail.com> writes:
I'm trying to compile boost.1_38_1 in Cygwin with GCC4.2.2, thanks!
That's not a valid boost version number. Do you mean 1.28.1 or 1.33.1 or 1.34.1?
Are you compiling with the appropriate threading option (-pthread, -mthread, or whatever --- check your gcc docs)?
Anthony -- Anthony Williams Just Software Solutions Ltd - http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- ------------------------------- Enjoy life! Barco You

Barco You <barcojie <at> gmail.com> writes:
Sorry, it's 1.34.1 :) what does -pthread mean? it means libpthread linked, why doesn't it be -lpthread?
gcc has various options for enabling multi-threaded support. These depend on the version of gcc and the platform. On some platforms/versions it is -pthread, on others -pthreads, on some it -mthread, and on some -mthreads. You will need to check the cygwin docs to find which to use (gcc --help -v might help). I think it's -mthreads. If all that was required was linking the pthread library, -lpthread would indeed be sufficient. However, gcc also changes the code it generates, and the runtime library functions it uses if multi-threaded support is enabled. Anthony

Thank you, Anthony! You make me benefit much! On 11/30/07, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
Barco You <barcojie <at> gmail.com> writes:
Sorry, it's 1.34.1 :) what does -pthread mean? it means libpthread linked, why doesn't it be -lpthread?
gcc has various options for enabling multi-threaded support. These depend on the version of gcc and the platform. On some platforms/versions it is -pthread, on others -pthreads, on some it -mthread, and on some -mthreads. You will need to check the cygwin docs to find which to use (gcc --help -v might help). I think it's -mthreads.
If all that was required was linking the pthread library, -lpthread would indeed be sufficient. However, gcc also changes the code it generates, and the runtime library functions it uses if multi-threaded support is enabled.
Anthony
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- ------------------------------- Enjoy life! Barco You
participants (2)
-
Anthony Williams
-
Barco You