UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
579 Views
Registered: ‎12-21-2018

Unable to use unordered_map in SDK

Jump to solution

I have been trying to declare an unordered_map in my SDK C code, initially the header "map" was not included then i added the path of the header in the directories of my project, with the help of one of the forum links, after which the header was successfully included. 

But even after including the header the declaration of unordered_map shows syntax error. I have attached the ss of a basic code to explain the situation. 

 Capture.PNG

Why is the syntax error present i am unable to understand can someone please help?

0 Kudos
1 Solution

Accepted Solutions
Mentor xilinxacct
Mentor
544 Views
Registered: ‎10-23-2018

Re: Unable to use unordered_map in SDK

Jump to solution

sakshigoyalsg999@gmail.com

Try compiling with the flag -std=c++11

6 Replies
Mentor xilinxacct
Mentor
545 Views
Registered: ‎10-23-2018

Re: Unable to use unordered_map in SDK

Jump to solution

sakshigoyalsg999@gmail.com

Try compiling with the flag -std=c++11

517 Views
Registered: ‎12-21-2018

Re: Unable to use unordered_map in SDK

Jump to solution

@xilinxacct thank you for the reply

I tried compiling with the flag '-std=c++11' some warnings appeared and the earlier errors remain as they were, i have attached the screenshot below.

Capture1.PNG

Please help!

0 Kudos
Highlighted
Mentor xilinxacct
Mentor
506 Views
Registered: ‎10-23-2018

Re: Unable to use unordered_map in SDK

Jump to solution

sakshigoyalsg999@gmail.com

HLS support is limited... it looks like  c++11 is not fully there... using c++98 I can 'compile/resolve' a map (but not unorder_map; which would be c++11)

So, can you try 'map' (and the c++98 flag)

That being said, that 'may' not work either... As I understand it, a STL that requires dynamic allocation is not supported.

464 Views
Registered: ‎12-21-2018

Re: Unable to use unordered_map in SDK

Jump to solution

Hey thanks a lot!!

Including the flag -std=c++11 finally did work the warning were due some changes i made earlier.

 

0 Kudos
Visitor mzrghorbani
Visitor
93 Views
Registered: ‎11-05-2017

Re: Unable to use unordered_map in SDK

Jump to solution

Hi, Could you tell me how you added the flag? Thanks

0 Kudos
74 Views
Registered: ‎12-21-2018

Re: Unable to use unordered_map in SDK

Jump to solution

Hey

To add the flag, select the project you are working on then go to project tab on the menu bar, followed by the following steps,

project --> properties --> C/C++ build --> Settings --> ARM v7 g++ compiler --> miscellaneous

After following these steps the following screen will appear. In the other flags you can add the flag -std=c++11.

Capture.PNG

0 Kudos