cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
yetanotherid
Observer
Observer
2,072 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
yetanotherid
Observer
Observer
2,175 Views
Registered: ‎12-08-2014

@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.

View solution in original post

3 Replies
ericv
Scholar
Scholar
2,017 Views
Registered: ‎04-13-2015

@yetanotherid

what about these 2 characters:

".h"

 

 

0 Kudos
zyanwu
Observer
Observer
1,996 Views
Registered: ‎12-14-2013
Try putting that header at the top of the include list.
Make it the first header to be included
yetanotherid
Observer
Observer
2,176 Views
Registered: ‎12-08-2014

@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.

View solution in original post