Boost.Thread 1.30 cause lot's of warnings and errors under vc 7.1

void foo(string & str) { str = "foo"; } int main(int argc, char * argv[]) { string str1("Hello world"); string str2(str1); thread trd1(bind(&foo, str1)); thread trd2(bind(&foo, str2)); trd1.join(); trd2.join(); return 0; } The following is the compile log: Compiling... testThread.cpp d:\Programming\boost\boost\boost\thread\exceptions.hpp(29) : warning C4275: non dll-interface class 'std::logic_error' used as base for dll-interface class 'boost::lock_error' c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stdexcept(14) : see declaration of 'std::logic_error' d:\Programming\boost\boost\boost\thread\exceptions.hpp(28) : see declaration of 'boost::lock_error' d:\Programming\boost\boost\boost\thread\exceptions.hpp(35) : warning C4275: non dll-interface class 'std::runtime_error' used as base for dll-interface class 'boost::thread_resource_error' c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stdexcept(136) : see declaration of 'std::runtime_error' d:\Programming\boost\boost\boost\thread\exceptions.hpp(34) : see declaration of 'boost::thread_resource_error' d:\Programming\boost\boost\boost\thread\mutex.hpp(37) : warning C4275: non dll-interface class 'boost::noncopyable' used as base for dll-interface class 'boost::mutex' d:\Programming\boost\boost\boost\noncopyable.hpp(22) : see declaration of 'boost::noncopyable' d:\Programming\boost\boost\boost\thread\mutex.hpp(36) : see declaration of 'boost::mutex' d:\Programming\boost\boost\boost\thread\mutex.hpp(75) : warning C4275: non dll-interface class 'boost::noncopyable' used as base for dll-interface class 'boost::try_mutex' d:\Programming\boost\boost\boost\noncopyable.hpp(22) : see declaration of 'boost::noncopyable' d:\Programming\boost\boost\boost\thread\mutex.hpp(74) : see declaration of 'boost::try_mutex' d:\Programming\boost\boost\boost\thread\mutex.hpp(115) : warning C4275: non dll-interface class 'boost::noncopyable' used as base for dll-interface class 'boost::timed_mutex' d:\Programming\boost\boost\boost\noncopyable.hpp(22) : see declaration of 'boost::noncopyable' d:\Programming\boost\boost\boost\thread\mutex.hpp(114) : see declaration of 'boost::timed_mutex' d:\Programming\boost\boost\boost\thread\thread.hpp(39) : warning C4275: non dll-interface class 'boost::noncopyable' used as base for dll-interface class 'boost::thread' d:\Programming\boost\boost\boost\noncopyable.hpp(22) : see declaration of 'boost::noncopyable' d:\Programming\boost\boost\boost\thread\thread.hpp(38) : see declaration of 'boost::thread' d:\Programming\boost\boost\boost\thread\thread.hpp(68) : warning C4275: non dll-interface class 'boost::noncopyable' used as base for dll-interface class 'boost::thread_group' d:\Programming\boost\boost\boost\noncopyable.hpp(22) : see declaration of 'boost::noncopyable' d:\Programming\boost\boost\boost\thread\thread.hpp(67) : see declaration of 'boost::thread_group' d:\Programming\boost\boost\boost\thread\thread.hpp(79) : warning C4251: 'boost::thread_group::m_threads' : class 'std::list<_Ty>' needs to have dll-interface to be used by clients of class 'boost::thread_group' with [ _Ty=boost::thread * ] d:\Programming\boost\boost\boost\bind.hpp(186) : error C2664: 'void (std::string &)' : cannot convert parameter 1 from 'const std::string' to 'std::string &' Conversion loses qualifiers d:\Programming\boost\boost\boost\bind\bind_template.hpp(21) : see reference to function template instantiation 'R boost::_bi::list1<A1>::operator ()<boost::_bi::bind_t<R,F,L>::result_type,void(__cdecl *)(std::string &),boost::_bi::list0>(boost::_bi::type<T>,F,A &) const' being compiled with [ R=boost::_bi::bind_t<void,void (__cdecl *)(std::string &),boost::_bi::list1<boost::_bi::list_av_1<std::string>::B1>>::result_type, A1=boost::_bi::list_av_1<std::string>::B1, F=void (__cdecl *)(std::string &), L=boost::_bi::list1<boost::_bi::list_av_1<std::string>::B1>, T=boost::_bi::bind_t<void,void (__cdecl *)(std::string &),boost::_bi::list1<boost::_bi::list_av_1<std::string>::B1>>::result_type, A=boost::_bi::list0 ] d:\Programming\boost\boost\boost\bind\bind_template.hpp(19) : while compiling class-template member function 'boost::_bi::bind_t<R,F,L>::result_type boost::_bi::bind_t<R,F,L>::operator ()(void)' with [ R=void, F=void (__cdecl *)(std::string &), L=boost::_bi::list1<boost::_bi::list_av_1<std::string>::B1> ] d:\Programming\project\testBoost\testThread\testThread.cpp(36) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled with [ R=void, F=void (__cdecl *)(std::string &), L=boost::_bi::list1<boost::_bi::list_av_1<std::string>::B1> ] Build log was saved at "file://d:\Programming\project\testBoost\testThread\Debug\BuildLog.htm" testThread - 1 error(s), 8 warning(s) Any suggestions are appreciated.

Black Ice said:
void foo(string & str) { str = "foo"; }
int main(int argc, char * argv[]) { string str1("Hello world"); string str2(str1);
thread trd1(bind(&foo, str1)); thread trd2(bind(&foo, str2)); trd1.join(); trd2.join(); return 0; }
This has been discussed on the developers list. As long as you use the same RTL, you can ignore these warnings. The next release will address this by removing the warnings through pragmas. -- William E. Kempf

Thanks -- /*******************/ ×ÔÓÉ£šliberty£©ÎÞ·ÇŸÍÊÇÕâÑùÒ»ÖÖ³Ðŵ£ºÃ¿žöÈËœ«»áµÃµœÒ»ÖÖ±£ÕÏ£¬±£ÕÏÎÒÃÇ¿ÉÒÔÓë ÈšÍþ¡¢¶àÊý¡¢Á÷Ë׌°ÓßÂÛµÄÓ°ÏìÏ࿹ºâ¡£ /*******************/ "William E. Kempf" <wekempf@cox.net> ÐŽÈëÏûÏ¢ÐÂÎÅ :1052.167.16.75.11.1048861944.squirrel@frodo.kempf-ville.com...
Black Ice said:
void foo(string & str) { str = "foo"; }
int main(int argc, char * argv[]) { string str1("Hello world"); string str2(str1);
thread trd1(bind(&foo, str1)); thread trd2(bind(&foo, str2)); trd1.join(); trd2.join(); return 0; }
This has been discussed on the developers list. As long as you use the same RTL, you can ignore these warnings. The next release will address this by removing the warnings through pragmas.
-- William E. Kempf
Info: <http://www.boost.org> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl> Unsubscribe: <mailto:boost-users-unsubscribe@yahoogroups.com>
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

The problem is the 'outgrowth' of dynamic link library. Why not privide static library? -- /*******************/ ×ÔÓÉ£šliberty£©ÎÞ·ÇŸÍÊÇÕâÑùÒ»ÖÖ³Ðŵ£ºÃ¿žöÈËœ«»áµÃµœÒ»ÖÖ±£ÕÏ£¬±£ÕÏÎÒÃÇ¿ÉÒÔÓë ÈšÍþ¡¢¶àÊý¡¢Á÷Ë׌°ÓßÂÛµÄÓ°ÏìÏ࿹ºâ¡£ /*******************/ "William E. Kempf" <wekempf@cox.net> ÐŽÈëÏûÏ¢ÐÂÎÅ :1052.167.16.75.11.1048861944.squirrel@frodo.kempf-ville.com...
Black Ice said:
void foo(string & str) { str = "foo"; }
int main(int argc, char * argv[]) { string str1("Hello world"); string str2(str1);
thread trd1(bind(&foo, str1)); thread trd2(bind(&foo, str2)); trd1.join(); trd2.join(); return 0; }
This has been discussed on the developers list. As long as you use the same RTL, you can ignore these warnings. The next release will address this by removing the warnings through pragmas.
-- William E. Kempf
Info: <http://www.boost.org> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl> Unsubscribe: <mailto:boost-users-unsubscribe@yahoogroups.com>
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
participants (2)
-
Black Ice
-
William E. Kempf