|
Boost Users : |
Subject: [Boost-users] A linking error on switch_statement. Can anyone with kindness help me?
From: fmingu (fmingu_at_[hidden])
Date: 2009-07-13 21:50:17
I am using Dev-C++ with boost 1.34.1,the program is the following:
.......................
typedef std::map<int, int> IIPrimemap;
IIPrimemap primemapvec;
# define BetaKGre2 1
# define EqualToOne 2
#define ProductOfKPrime 3
.........................
(switch_statement(_1,
case_statement<BetaKGre2>
(var(result)=0),
case_statement<EqualToOne>
(var(result)=1),
case_statement<ProductOfKPrime>
(var(result)=bind(static_cast<long double (*)(long double,int)>(std::pow),
constant(-1.0),bind(&IIPrimemap::size,var(primemapvec)))),
default_statement
( var(result)=234)
))(switchvalue);
the complier told me no errors.But the linker told me that:
nstantiated from `Arg::sig<boost::tuples::tuple<A&, B&, C&, Env&, boost::tuples::null_type, boost::tuples::null_type, boost.........
instantiated from `RET boost::lambda::lambda_functor_base<boost::lambda::s................
nstantiated from `T::sig<boost::tuples::tuple<A&, boost::tuples::null_type, boost::tuples::null_type, bo...........
instantiated from here..........// indicating the line:
))(switchvalue);
And after the second compling and linking , the program passed and ran.
I do not know why. And this was caused after I added the line:
(var(result)=bind(static_cast<long double (*)(long double,int)>(std::pow),
constant(-1.0),bind(&IIPrimemap::size,var(primemapvec)))),
otherwise the program do not have such problems. How can I solve it?
Can anyone with kindness help me?
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net