Results 1 to 3 of 3

Thread: Failure of STL map "insert()" (VxWorks v6.8). ... MIPS

  1. #1
    Join Date
    Aug 2013
    Posts
    2
    Rep Power
    1

    Default Failure of STL map "insert()" (VxWorks v6.8). ... MIPS

    A_MAP.insert(std:air<uint16_t, THE_STRUCT_TYPE>(Key, A_STRUCT))

    A_MAP[Key] = A_STRUCT;

    Both methods work on Visual C++ Express 2012.

    Both methods fail on VxWorks at run-time with Signal 11.

    However, the following does not crash on VxWorks (but since nothing has been inserted, the pair values will be the (un)initialized values):

    std::map<uint16_t, THE_STRUCT_TYPE>::iterator itBegin = A_MAP.begin;
    printf("A_MAP.begin = %d\n", itBegin);

    I woudl appreciate assistance/guidance from anyone with knowledge of the use of STL maps on VxWorks v6.8.

    The two methods described use copy construction. Thsi may be the problem for VxWorks, e.g., it may not support copying user defined types. A third method, emplace(), constructs in place but is only available in "C++ 2011".


    FWIW:

    typedef THE_STRUCT_TYPE
    {
    char a_char;
    uint16_t an_int_array[20];
    char a_char_array[10];
    uint16_t an_int;

    } THE_STRUCT_TYPE

    Any news on the use of the map container in v6.8 ? This is really a straightforward usage.

    Some documentation exists regarding compile/link flags to specify the range of STL functionality that's available, and even which compler (Diablo/EDG/VxWorks C++ versus GNU C++) to use. This is an administerred tool, for which I have little control/access, adminned by administrators to whom I have little access, so getting license numbers, C++ compiler usage info, etc., is difficult.

    I woudl like to know, though, if this type of failure justifies makign that type of effort.


    Also, does v6.9 implement the C++ 2011 Standard, specifically the std::unordered_map container ?

  2. #2
    Join Date
    Aug 2013
    Posts
    2
    Rep Power
    1

    Default Re: Failure of STL map "insert()" (VxWorks v6.8). ... MIPS

    Solved.

    It seems that, to which I have elsewhere seen it alluded, the mapped type must, at least in some cases, be a pointer; presumably solving the copy construction prohibition and the unavailability, in pre-C++-2011 installations, of the emplace method.

    Thus, declaration of the map object would be accomplished as follows:

    std::map<uint16_t, THE_STRUCT_TYPE*> A_MAP;

    Insertion procedes as:

    A_MAP[Key] = &A_STRUCT;



    Question remaining open:

    Does v6.9 implement the C++ 2011 Standard, specifically the std::unordered_map container ?

  3. #3
    Join Date
    Aug 2004
    Location
    Texas Y'all
    Posts
    2,329
    Rep Power
    1

    Default Re: Failure of STL map "insert()" (VxWorks v6.8). ... MIPS

    Moving to the new "Other Operating Systems" forum. This is where all non-Linux OS related questions will go moving forward.

Similar Threads

  1. Replies: 1
    Last Post: August 13th, 2012, 11:12 AM
  2. error:Port "enable" does not exist in primitive "latch" of instance "u0"
    By MR_Naidu in forum Quartus II and EDA Tools Discussion
    Replies: 5
    Last Post: February 25th, 2012, 10:36 AM
  3. Error: Port "i1" does not exist in primitive "nand2" of instance "g2"
    By alizadeharand in forum Quartus II and EDA Tools Discussion
    Replies: 1
    Last Post: July 24th, 2011, 10:23 PM
  4. Port "data0" does not exist in primitive "and2" of instance "U1"
    By robocon in forum Quartus II and EDA Tools Discussion
    Replies: 12
    Last Post: December 5th, 2010, 03:52 AM
  5. Flash programming "Auto Detect" failure
    By randallwmelton in forum Development Kit Related
    Replies: 3
    Last Post: January 13th, 2010, 02:42 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •