random_demo.cpp doesn't work with VC++6.0?

Hi, I failed to compile random_demo.cpp (www.boost.org/libs/random/random_demo.cpp) with VC++6.0 under WINXP sp2. I have attached the error message below. (I have installed VC++6.0 service pack 4,5 and 6.) Could anybody help? Examples of using boost::random will help too, such as uniform_01 and normal_distribution, etc. Thanks a lot. Vivid (test2.cpp is random_demo.cpp) e:\shared\boost_1_32_0\boost\random\detail\ptr_helper.hpp(29) : error C2529: '<Unknown>' : reference to reference is illegal e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(32) : see reference to class template instantiation 'boost::random::detail::ptr_helper<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\ptr_helper.hpp(30) : warning C4181: qualifier applied to reference type ignored e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(32) : see reference to class template instantiation 'boost::random::detail::ptr_helper<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\ptr_helper.hpp(30) : error C2529: '<Unknown>' : reference to reference is illegal e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(32) : see reference to class template instantiation 'boost::random::detail::ptr_helper<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\ptr_helper.hpp(31) : error C2529: '<Unknown>' : reference to reference is illegal e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(32) : see reference to class template instantiation 'boost::random::detail::ptr_helper<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\ptr_helper.hpp(32) : warning C4181: qualifier applied to reference type ignored e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(32) : see reference to class template instantiation 'boost::random::detail::ptr_helper<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\ptr_helper.hpp(32) : warning C4181: qualifier applied to reference type ignored e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(32) : see reference to class template instantiation 'boost::random::detail::ptr_helper<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\ptr_helper.hpp(32) : error C2529: '<Unknown>' : reference to reference is illegal e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(32) : see reference to class template instantiation 'boost::random::detail::ptr_helper<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\ptr_helper.hpp(32) : error C2529: '<Unknown>' : reference to reference is illegal e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(32) : see reference to class template instantiation 'boost::random::detail::ptr_helper<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(33) : error C2039: 'result_type' : is not a member of '`global namespace'' e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(33) : error C2146: syntax error : missing ';' before identifier 'result_type' e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(33) : error C2868: 'result_type' : illegal syntax for using-declaration; expected qualified-name e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(42) : error C2529: '<Unknown>' : reference to reference is illegal e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(43) : warning C4181: qualifier applied to reference type ignored e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\detail\pass_through_engine.hpp(43) : error C2529: '<Unknown>' : reference to reference is illegal e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(90) : see reference to class template instantiation 'boost::random::detail::pass_through_engine<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &>' being c ompiled E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(104) : error C2529: '<Unknown>' : reference to reference is illegal E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(105) : warning C4181: qualifier applied to reference type ignored E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(105) : error C2529: '<Unknown>' : reference to reference is illegal E:\temp\test2\test2.cpp(71) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_real<double> >' being compiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(104) : error C2529: '<Unknown>' : reference to reference is illegal E:\temp\test2\test2.cpp(116) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_int<int> >' being compiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(105) : warning C4181: qualifier applied to reference type ignored E:\temp\test2\test2.cpp(116) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_int<int> >' being compiled e:\shared\boost_1_32_0\boost\random\variate_generator.hpp(105) : error C2529: '<Unknown>' : reference to reference is illegal E:\temp\test2\test2.cpp(116) : see reference to class template instantiation 'boost::variate_generator<class boost::random::linear_congruential<long,48271,0,2147483647,399268537> &,class boost::uniform_int<int> >' being compiled E:\temp\test2\test2.cpp(124) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class boost::random::linear_congruential<long,48271,0,2147483647,399268537>' (or there is no acceptable conversion) Error executing cl.exe.

"Vivid Yang" <yyd_iris@yahoo.com> writes:
I failed to compile random_demo.cpp (www.boost.org/libs/random/random_demo.cpp) with VC++6.0 under WINXP sp2. I have attached the error message below. (I have installed VC++6.0 service pack 4,5 and 6.) Could anybody help?
If you go to http://tinyurl.com/53scv#random You'll see that the Boost developers also never got it working on vc6. -- Dave Abrahams Boost Consulting www.boost-consulting.com

Woo, it is a wonderful site! Thanks, David! Does the failure of demo imply the failure of the whole random library? So is it still worthy of trying to use boost::random in VC++6.0? I have this question because I saw graph.cpp failed under msvc too. I am writing an application of boost::graph with msvc right now. So far so good. I try to understand the risk of continuing using boost::graph. "David Abrahams" <dave@boost-consulting.com> wrote in message news:u3bu35gt4.fsf@boost-consulting.com...
"Vivid Yang" <yyd_iris@yahoo.com> writes:
I failed to compile random_demo.cpp (www.boost.org/libs/random/random_demo.cpp) with VC++6.0 under WINXP sp2. I have attached the error message below. (I have installed VC++6.0 service pack 4,5 and 6.) Could anybody help?
If you go to http://tinyurl.com/53scv#random You'll see that the Boost developers also never got it working on vc6.
-- Dave Abrahams Boost Consulting www.boost-consulting.com

"David Abrahams" <dave@boost-consulting.com> wrote in message news:u3bu35gt4.fsf@boost-consulting.com...
"Vivid Yang" <yyd_iris@yahoo.com> writes:
I failed to compile random_demo.cpp (www.boost.org/libs/random/random_demo.cpp) with VC++6.0 under WINXP sp2. I have attached the error message below. (I have installed VC++6.0 service pack 4,5 and 6.) Could anybody help?
If you go to http://tinyurl.com/53scv#random You'll see that the Boost developers also never got it working on vc6.
If I remember, mersienne_twister didn't compile on VC6. If you must use on VC6, you might try using another random number generator. Also include only the specific headers you want, not 'boost/random.hpp'. HTH -- Best regards, Sebastien mailto:smartel@real.com
participants (3)
-
David Abrahams
-
Sebastien Martel
-
Vivid Yang