I'm setting up and environment with the gcc-arm-none-eabi toolchain (currently 7.2.1). This is for an ARM cortex M4 embedded device.
I'd like to redefine printf for the entire project, but I'm having trouble. I want to use this implementation. I've installed this into the project, and I can use it by calling, for example: printf_("Test: %i",5);
and everything works as expected.
Now I want to set it as the default printf function. If I uncomment: #define printf printf_
, I get the following error:
/home/timv/.platformio/packages/[email protected]/arm-none-eabi/include/c++/7.2.1/cstdio:127:11: error: '::printf' has not been declared
using ::printf;
later on:
src/LoggerTask.cpp:62:5: error: 'printf' was not declared in this scope
In that file I found this line:
#undef printf
When I comment that line out, the project builds, and printf works. This is good, but I would like to have my project function without patching the toolchain.
How should I go about doing this? What other information would be helpful?
#undef printf
in yourLoggerTask.cpp
?f I uncomment: #define printf printf_
- in which file is that define located? – KamilCukmyprintf
instead in your source code? – Basile Starynkevitch