04-30-2014 12:10 PM
I am attempting to use a stringstream object in my C++ project, but every time I use the str() method, I get a bunch of errors:
f:\xilinx\sdk\2014.1\gnu\arm\nt\arm-xilinx-eabi\include\c++\4.8.1\sstream:126:11: error: macro "str" requires 2 arguments, but only 1 given
I traced the issue back down to xpseudo_asm_gcc.h, where it defines str(arg, arg) as an assembly instruction. This is obviously a bit of an issue - it is using the assembly define instead of the string call, which is all sorts of not okay. I feel that I must be doing something very wrong, but for the life of me I can't figure out what. I tried excluding xpseudo_asm_gcc.h, but it is needed for interrupt handling. Any hints anyone can provide would be appreciated.
05-06-2014 06:51 AM
Thanks for helping me out - I really appreciate it.
Attached is an example application that has the same issue as my primary program - the main program is far too large to attach. I apologize for the size, but in the interest of completeness, I wanted to give you all of the generated files as well.
A couple things of interest: I first tried to build a simple application with just a stringstream converted to a string via stringstream::str(), but that worked just fine. I increased the complexity by starting with the base lwip-echo example and adding the stringstream test, and that threw the requisite error.
Please let me know if you need any additional information.
05-06-2014 08:02 PM
Another note - it's hackish, but I got the application working by undefining str in the preprocessor before calling stringstream::str. It's a solution, but I can easily see it creating serious issues if used without understanding the full implications of what the str(arg, arg) macro does within the pseudo_asm_gcc.h file.
05-06-2014 09:47 PM
There is a custom driver by name e_step_top that is missing in your BSP. I cannot compile the design without the driver.
Also please post the error message that you are seeing.
05-07-2014 02:56 PM
07-24-2015 06:59 AM
I kinda hacked my way around it - in the file where stringstream is required, stick this at the top
Sad, but appears to work.
01-05-2017 05:40 PM