Question

I am trying to run the "getting started" example:

#include <boost/lambda/lambda.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>

int main()
{
    using namespace boost::lambda;
    typedef std::istream_iterator<int> in;

    std::for_each(
        in(std::cin), in(), std::cout << (_1 * 3) << " " );
}

after downloading the boost library to my machine. But I can't get it running. After googling, all I found is to add:

#define BOOST_REGEX_USE_VCL
#define BOOST_NO_OPERATORS_IN_NAMESPACE
#define BOOST_NO_STD_LOCALE

That still didn't help. The error is:

[C++ Error] lambda_traits.hpp(435): E2238 Multiple declaration for 'bind_traits<R>'
[C++ Error] lambda_traits.hpp(389): E2344 Earlier declaration of 'bind_traits<R>'

Anybody any (further) ideas? As stated in the headline I'm running with the 5.82 version of the Borland compiler.

Oh...and please don't suggest to use another compiler. I'm at work, and I'm not my own boss. :-/

;-)

Was it helpful?

Solution

I think boost::lambda doesn't work with 5.8.2 - It may not even work with the very latest C++Builder compiler.

Have a look at the results on the bcbboost pages, and keep an eye on David Dean's blog.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top