cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Voyager
Voyager
948 Views
Registered: ‎05-30-2018

Using C++ containers (e.g. "array", "list", "set", "map") in ARM9 application

Hello,

I've tried to use C++ containers like array, map, set, etc. in my ARM9 application, but it seems that they aren't supported.

At least theirs headers aren't recognized by SDK.

Would it be possible to add container support in Xilinx SDK.

Thanks in advance.

 

0 Kudos
3 Replies
Highlighted
Advisor
Advisor
939 Views
Registered: ‎04-26-2015

Bare metal, or under Linux?

 

A lot of the C++ libraries require an operating system, because they rely on that to manage dynamic memory allocation (among other things).

0 Kudos
Highlighted
Voyager
Voyager
922 Views
Registered: ‎05-30-2018

For the moment Bare metal

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
881 Views
Registered: ‎11-02-2011

Hi,

I have created a sample array c++ application for ZC706_hw_platform and it worked fine

#include <string>
#include <iterator>
#include <iostream>
#include <algorithm>
#include <array>

int main()
{
std::array<int, 3> a1{ {1, 2, 3} }; // double-braces required in C++11 (not in C++14)
std::array<int, 3> a2 = {1, 2, 3}; // never required after =
std::array<std::string, 2> a3 = { std::string("a"), "b" };
std::sort(a1.begin(), a1.end());
std::reverse_copy(a2.begin(), a2.end(),
std::ostream_iterator<int>(std::cout, " "));

std::cout << '\n';
for(const auto& s: a3)
std::cout << s << ' ';
}

 

Have you tried something similar?

array.png
0 Kudos