简体   繁体   English

在Borland C ++命令行工具中使用Boost库

[英]Using Boost library with Borland C++ Command Line Tool

I have problem in compiling C++ code containing boost (1.55.0) using Borland C++ Command Line Tool (Borland C++ 5.5.1 for Win32). 我在使用Borland C ++命令行工具(Borland C ++ 5.5.1 for Win32)编译包含boost(1.55.0)的C ++代码时遇到问题。

I test the example from Boost Getting Started page, example.cpp: 我测试了Boost Getting Started页面中的示例example.cpp:

#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) << " " );
    return 0;
}

I have modified the bcc32.cfg file to include the boost headers as follows: 我修改了bcc32.cfg文件以包含boost标头,如下所示:

-I"c:\Borland\Bcc55\include"
-I"C:\boost_1_55_0"
-L"c:\Borland\Bcc55\lib"

Then, I try to compile using bcc32 example.cpp , getting the following errors: 然后,我尝试使用bcc32 example.cpp进行编译,得到以下错误:

Error E2221 C:\boost_1_55_0\boost/static_assert.hpp 62: Macro argument syntax error
Error E2221 C:\boost_1_55_0\boost/static_assert.hpp 182: Macro argument syntax error
Error E2238 C:\boost_1_55_0\boost/tuple/detail/tuple_basic.hpp 429: Multiple declaration for 'length<tuple<null_type,null_type,null_type,null_type,null_type,null_type,null_type,null_type,null_type,null_type> >'
Error E2344 C:\boost_1_55_0\boost/tuple/detail/tuple_basic.hpp 424: Earlier declaration of 'length<tuple<null_type,null_type,null_type,null_type,null_type,null_type,null_type,null_type,null_type,null_type> >'
Error E2238 C:\boost_1_55_0\boost/tuple/detail/tuple_basic.hpp 439: Multiple declaration for 'length<null_type>'
Error E2344 C:\boost_1_55_0\boost/tuple/detail/tuple_basic.hpp 434: Earlier declaration of 'length<null_type>'
Error E2108 C:\boost_1_55_0\boost/tuple/detail/tuple_basic.hpp 700: Improper use of typedef 'detail::ignore_t'
Error E2299 C:\boost_1_55_0\boost/tuple/detail/tuple_basic.hpp 700: Cannot generate template specialization from 'make_tuple_traits<T>'
Error E2321 C:\boost_1_55_0\boost/tuple/detail/tuple_basic.hpp 702: Declaration does not specify a tag or an identifier
Error E2108 C:\boost_1_55_0\boost/tuple/detail/tuple_basic.hpp 832: Improper use of typedef 'ignore_t'
Error E2299 C:\boost_1_55_0\boost/tuple/detail/tuple_basic.hpp 832: Cannot generate template specialization from 'tie_traits<T>'
Error E2321 C:\boost_1_55_0\boost/tuple/detail/tuple_basic.hpp 834: Declaration does not specify a tag or an identifier
Error E2401 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 89: Invalid template argument list
Error E2040 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 91: Declaration terminated incorrectly
Error E2401 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 256: Invalid template argument list
Error E2040 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 257: Declaration terminated incorrectly
Error E2238 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 408: Multiple declaration for 'bind_traits<null_type>'
Error E2344 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 401: Earlier declaration of 'bind_traits<null_type>'
Error E2434 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 435: Template declaration missing template parameters ('template<...>')
Error E2238 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 435: Multiple declaration for 'bind_traits<R>'
Error E2344 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 389: Earlier declaration of 'bind_traits<R>'
Error E2108 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 440: Improper use of typedef 'Arg1'
Error E2299 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 440: Cannot generate template specialization from 'bind_traits<R>'
Error E2428 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 442: Templates must be classes or functions
Error E2108 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 445: Improper use of typedef 'Arg1' 
Error E2228 C:\boost_1_55_0\boost/lambda/detail/lambda_traits.hpp 445: Too many error or warning messages
*** 26 errors in Compile ***

Borland C++ has a lot of standard compliance issues, this is probably a futile endeavour. Borland C ++有许多标准的合规性问题,这可能是徒劳的努力。 Boost officially dropped support for bcc32.exe 10 years ago. 10年前,Boost正式放弃了对bcc32.exe的支持。

C++Builder XE does come with a working version of boost, perhaps you could look into using this instead of bcc 5.5. C ++ Builder XE确实带有一个工作版本的boost,也许您可​​以考虑使用它来代替bcc 5.5。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM