This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C2000 compiler v6.4.9: Is boost compatible with C2000 C++ compiler

Guru 20035 points

Hello,

I am getting many errors when I try to compile boost v1.59.0 circular buffer with a simple test program shown on the boost website(i.e.  and shown below).

Has anyone used boost with the C2000 compiler.  If so, do you have any suggestions.

To remove several errors I defined BOOST_NO_CXX11_VARIADIC_TEMPLATES.  

Stephen

/*
 * main.c
 */

#include <boost/circular_buffer.hpp>

int main(void) {
	
    // Create a circular buffer with a capacity for 3 integers.
    boost::circular_buffer<int> cb(3);

    // Insert threee elements into the buffer.
    cb.push_back(1);
    cb.push_back(2);
    cb.push_back(3);

    int a = cb[0];  // a == 1
    int b = cb[1];  // b == 2
    int c = cb[2];  // c == 3

    // The buffer is full now, so pushing subsequent
    // elements will overwrite the front-most elements.

    cb.push_back(4);  // Overwrite 1 with 4.
    cb.push_back(5);  // Overwrite 2 with 5.

    // The buffer now contains 3, 4 and 5.
    a = cb[0];  // a == 3
    b = cb[1];  // b == 4
    c = cb[2];  // c == 5

    // Elements can be popped from either the front or the back.
    cb.pop_back();  // 5 is removed.
    cb.pop_front(); // 3 is removed.

    // Leaving only one element with value = 4.
    int d = cb[0];  // d == 4

	return 0;
}

 

  • The best information we have is in this wiki article.  However, that information is out of date.  If we see more requests like this one, then we will probably update it.

    Thanks and regards,

    -George

  • Ok...I give up.

    The recommended boost version (i.e. 1.34.1) described on that webpage doesn't even have circular buffers.  I was trying to use version 1.59.0.

    Also, CCSv6.1.1 doesn't even put --exception on the command line after  I select "Enable C++ exception handling (--exceptions) in Build->C2000 Compiler->Advanced Options->Language Options.  I Believe that is a CCS issue.

    So far, I have defined the following items shown below.  Also, the errors are also shown below.

    Stephen

    BOOST_NO_CXX11_VARIADIC_TEMPLATES
    BOOST_NO_CXX11_CHAR16_T
    BOOST_NO_CXX11_CHAR32_T
    BOOST_NO_INTRINSIC_WCHAR_T
    BOOST_NO_CXX11_DECLTYPE
    BOOST_NO_CXX11_NULLPTR
    BOOST_NO_CXX11_RVALUE_REFERENCES
    BOOST_NO_CXX11_STATIC_ASSERT
    BOOST_NO_CXX11_TEMPLATE_ALIASES
    BOOST_NO_CXX11_NOEXCEPT
    BOOST_NO_CXX14_CONSTEXPR
    BOOST_NO_CXX11_CONSTEXPR
    Description	Resource	Path	Location	Type
    #136 class "std::allocator<int>" has no member "const_void_pointer"	.ccsproject	/TestBoostCircularBuffer	line 108, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\container\allocator_traits.hpp	C/C++ Problem
    #136 class "std::allocator<int>" has no member "is_always_equal"	.ccsproject	/TestBoostCircularBuffer	line 113, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\container\allocator_traits.hpp	C/C++ Problem
    #136 class "std::allocator<int>" has no member "is_partially_propagable"	.ccsproject	/TestBoostCircularBuffer	line 115, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\container\allocator_traits.hpp	C/C++ Problem
    #136 class "std::allocator<int>" has no member "propagate_on_container_copy_assignment"	.ccsproject	/TestBoostCircularBuffer	line 110, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\container\allocator_traits.hpp	C/C++ Problem
    #136 class "std::allocator<int>" has no member "propagate_on_container_move_assignment"	.ccsproject	/TestBoostCircularBuffer	line 111, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\container\allocator_traits.hpp	C/C++ Problem
    #136 class "std::allocator<int>" has no member "propagate_on_container_swap"	.ccsproject	/TestBoostCircularBuffer	line 112, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\container\allocator_traits.hpp	C/C++ Problem
    #136 class "std::allocator<int>" has no member "void_pointer"	.ccsproject	/TestBoostCircularBuffer	line 107, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\container\allocator_traits.hpp	C/C++ Problem
    #20 identifier "size_t" is undefined	.ccsproject	/TestBoostCircularBuffer	line 483, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 1000, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 988, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 989, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 990, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 991, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 992, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 993, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 994, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 995, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 996, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 997, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 998, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #41 expected an identifier	.ccsproject	/TestBoostCircularBuffer	line 999, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\move\detail\type_traits.hpp	C/C++ Problem
    #542 support for exception handling is disabled	.ccsproject	/TestBoostCircularBuffer	line 472, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\exception\exception.hpp	C/C++ Problem
    #542 support for exception handling is disabled	.ccsproject	/TestBoostCircularBuffer	line 69, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\throw_exception.hpp	C/C++ Problem
    #66 expected a ";"	.ccsproject	/TestBoostCircularBuffer	line 27, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\core\noncopyable.hpp	C/C++ Problem
    #66 expected a ";"	.ccsproject	/TestBoostCircularBuffer	line 28, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\core\noncopyable.hpp	C/C++ Problem
    #66 expected a ";"	.ccsproject	/TestBoostCircularBuffer	line 34, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\core\noncopyable.hpp	C/C++ Problem
    #66 expected a ";"	.ccsproject	/TestBoostCircularBuffer	line 35, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\core\noncopyable.hpp	C/C++ Problem
    #66 expected a ";"	.ccsproject	/TestBoostCircularBuffer	line 612, external location: C:\Users\stm\Downloads\boost_1_59_0\boost_1_59_0\boost\iterator\iterator_facade.hpp	C/C++ Problem

  • stevenh said:
    CCSv6.1.1 doesn't even put --exception on the command line after  I select "Enable C++ exception handling (--exceptions) in Build->C2000 Compiler->Advanced Options->Language Options.  I Believe that is a CCS issue.

    I am unable to reproduce this issue.  I'd appreciate if you would attach your project to your next post.  I'll ask one of the CCS experts to take a look.

    Thanks and regards,

    -George

  • I forgot to add some information to my post. It won't work if the files have a .c extension and "Treat C files as C++ files" is selected.
  • The compiler team doesn't have any experience with Boost versions more recent than what is on the wiki page on the targets. I did some web searching, and the prevailing thought seems to be that Boost should work with a compiler that supports only C++03, like the TI compiler, but I think you're experiencing a counterexample. I did find the following page, perhaps it is related?
    stackoverflow.com/.../how-to-build-boost-with-c0x-support
  • I am not exactly sure what they are trying to do on that webpage.  It looks like someone just wants to know what compiler flags to get C++03 support.

    Anyways, I'll just leave it for now and come back to it later.  I wrote my own simpler circular buffer template.

    Thanks,

    Stephen