使用borland编译器5.82运行boost库

时间:2010-12-06 13:38:41

标签: c++ boost borland-c++

我正在尝试运行“入门”示例:

#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) << " " );
}
将boost库下载到我的机器后

。但我不能让它运行。 谷歌搜索后,我发现只是添加:

#define BOOST_REGEX_USE_VCL
#define BOOST_NO_OPERATORS_IN_NAMESPACE
#define BOOST_NO_STD_LOCALE

那仍然没有帮助。错误是:

[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>'

任何人(进一步)的想法?正如标题所述,我正在使用5.82版本的Borland编译器。

哦......请不要建议使用其他编译器。我在工作,我不是我自己的老板。 : - /

- )

1 个答案:

答案 0 :(得分:1)

我认为boost :: lambda不适用于5.8.2 - 它甚至可能不适用于最新的C ++ Builder编译器。

查看bcbboost页面上的搜索结果,并留意David Dean's blog.