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: 
Visitor seek64
Visitor
2,499 Views
Registered: ‎10-04-2017

"hls_half.h": Error: no member named '...' in namespace 'std'

Hello everyone,

 

I recently switched to SDx 2017.2. After trying to import and build a project, SDx prints out the following error messages regarding "hls_half.h":

 

C:/Xilinx/SDx/2017.2/Vivado_HLS/include/hls_half.h:2187:17: error: no member named 'fmax' in namespace 'std'; did you mean simply 'fmax'?
                                return expr(std::fmax(x, y));
                                            ^~~~~~~~~
                                            fmax

This happens for every c++11 function included from cmath. I tried specifying "-std=c++11" in the compiler options, but without success.

 

I currently using a workaround by hardcoding the functions into "half_hls.h"....

 

Thanks a lot,

Seek

 

 

0 Kudos
11 Replies
Visitor zhch7777
Visitor
2,414 Views
Registered: ‎09-07-2011

Re: "hls_half.h": Error: no member named '...' in namespace 'std'

hi  seek64

     i havethe same problem, and in SDCOC 2017.02?

     how can you solve the problem.my project have the error yet

thanks

0 Kudos
Visitor seek64
Visitor
2,391 Views
Registered: ‎10-04-2017

Re: "hls_half.h": Error: no member named '...' in namespace 'std'

Hello zhch7777,

 

try adding

 

#define HALF_ENABLE_CPP11_CMATH 0

at the top of the "hls_half.h" file. Not a 100% clean solution, but worked for me. :)

 

Regards,

Seek

0 Kudos
Participant zhch777777
Participant
2,369 Views
Registered: ‎10-27-2017

Re: "hls_half.h": Error: no member named '...' in namespace 'std'

hi  seek64

   thank for reply,

   yes i  add 

#define HALF_ENABLE_CPP11_CMATH 0

  and could compile with warning.but can not build elf file 

  do you have the same problem.

0 Kudos
Highlighted
Visitor seek64
Visitor
2,364 Views
Registered: ‎10-04-2017

Re: "hls_half.h": Error: no member named '...' in namespace 'std'

Hello,

 

no unfortunately I do not get this error, so I don't know how to fix it. :/

 

I also do not get the warnings before.

 

I had another workaround before I found this by replacing the hls_half.h from 2017.2 with the one from 2017.1.

 

There is the one from 2017.1 attached, maybe this will help you.

 

Regards,

Seek

0 Kudos
Participant zhch777777
Participant
2,348 Views
Registered: ‎10-27-2017

Re: "hls_half.h": Error: no member named '...' in namespace 'std'

hello

      thanks

       i have the same problem by the 2017.01 hls_half.h

       i cant do any thing,but waiting for the new SDX 

0 Kudos
Observer kami
Observer
1,313 Views
Registered: ‎03-18-2017

Re: "hls_half.h": Error: no member named '...' in namespace 'std'

Hi,
I have the same problem in SDSoC 2018.2
Still nothing to fix it?
0 Kudos
Teacher xilinxacct
Teacher
1,308 Views
Registered: ‎10-23-2018

Re: "hls_half.h": Error: no member named '...' in namespace 'std'

@kami

@seek64

@zhch777777

@zhch7777

Here are two things to try...

1) remove the std:: (and any using namespace std)... e.g. just call fmax with no namespace (you should include the the math include file)

OR

2) define your own FMAX macro, and call that instead e.g. #define FMAX(_a, _b) ((_a) >= (_b)) ? (_a) : (_b)

Hope that helps

0 Kudos
Observer kami
Observer
1,272 Views
Registered: ‎03-18-2017

Re: "hls_half.h": Error: no member named '...' in namespace 'std'

Thanks for your reply @xilinxacct, but same project works good on another PC without any code change. Both are SDSoC 2018.2 and the only difference between them is Ubuntu versions (16.04 and 18.04). I checked includes and libraries. I tried -std=c++11 flag but still it can't build.

 

0 Kudos
Teacher xilinxacct
Teacher
1,256 Views
Registered: ‎10-23-2018

Re: "hls_half.h": Error: no member named '...' in namespace 'std'

@kami

With both of those suggestions, you should not need the std=c++11 flag any more, since it is as basic as it gets at that point. Using 2018.2 The compiler worked fine for both of those methods. Suggestion #2 is just code, so doesn't even count on a library. Maybe you have some other issue (especially, as you say, it works elsewhere)

0 Kudos
Observer kami
Observer
1,174 Views
Registered: ‎03-18-2017

Re: "hls_half.h": Error: no member named '...' in namespace 'std'

Hi,

I fixed the problem with updating the petalinux platform file which I was downloaded from Avnet Ultra96 support page. I think sw part of the platform folder is updated in the new version and it works ok in SDSoC 2018.2.

 

0 Kudos
Visitor yugi_nhc
Visitor
525 Views
Registered: ‎06-27-2018

Re: "hls_half.h": Error: no member named '...' in namespace 'std'

Hi, I also have this problem when working with SDSoC 2018.2 on Windows 10.

#define HALF_ENABLE_CPP11_CMATH 0 can compile but can not create elf file.

Do you know how to fix it on SDSoC 2018.2 Windows

0 Kudos