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 yetanotherid
Visitor
1,104 Views
Registered: ‎12-08-2014

#include <complex> fails?

Jump to solution

Hopefully this is just me being dumb, but this:

 

#include <complex>

generates an error in SDK 2018.1:

 

In file included from c:\xilinx\sdk\2018.1\gnu\aarch32\nt\gcc-arm-none-eabi\arm-none-eabi\include\c++\7.2.1\complex:45:0,
                 from ../src/dma_test.cpp:4:
c:\xilinx\sdk\2018.1\gnu\aarch32\nt\gcc-arm-none-eabi\arm-none-eabi\include\c++\7.2.1\sstream:166:11: error: macro "str" requires 2 arguments, but only 1 given
       str() const
           ^

What's going on here? In all my searches I haven't found someone else with this problem, which is why I feel like I must be doing something silly.

(C++ project, standalone OS, ARMv7 toolchain)

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Visitor yetanotherid
Visitor
1,207 Views
Registered: ‎12-08-2014

Re: #include <complex> fails?

Jump to solution

@ericv, @zyanwu, thanks for your suggestions! Here is the problem and solution:

 

This generates compiler errors:

#include "xaxidma.h"
#include <complex>

This compiles successfully:

#include <complex>
#include "xaxidma.h"

I stepped down into the rabbit hole of includes, and found that the culprit is somewhere within "xpseudo_asm_gcc.h". So it seems that some macro in there is clobbering something in the GNU STL. From this I take the lesson that all non-Xilinx includes should be #include-d first.

0 Kudos
3 Replies
Scholar ericv
Scholar
1,049 Views
Registered: ‎04-13-2015

Re: #include <complex> fails?

Jump to solution

@yetanotherid

what about these 2 characters:

".h"

 

 

0 Kudos
Observer zyanwu
Observer
1,028 Views
Registered: ‎12-14-2013

Re: #include <complex> fails?

Jump to solution
Try putting that header at the top of the include list.
Make it the first header to be included
Highlighted
Visitor yetanotherid
Visitor
1,208 Views
Registered: ‎12-08-2014

Re: #include <complex> fails?

Jump to solution

@ericv, @zyanwu, thanks for your suggestions! Here is the problem and solution:

 

This generates compiler errors:

#include "xaxidma.h"
#include <complex>

This compiles successfully:

#include <complex>
#include "xaxidma.h"

I stepped down into the rabbit hole of includes, and found that the culprit is somewhere within "xpseudo_asm_gcc.h". So it seems that some macro in there is clobbering something in the GNU STL. From this I take the lesson that all non-Xilinx includes should be #include-d first.

0 Kudos