EmBitz Errors when building

Hello,

I successfully added a new build target to PokittoLib on EmBitz as it is shown in this tutorial. At the beginning it worked fine. But after same changes in the code, there are errors shown when compiling the project on EmBitz. The compiling on Code Blocks works fine and there aren’t any errors shown up when using the simulator. But I can’t create a .bin file with EmBitz. Two things I added were:
#include <string>
and
using namespace std;
I also added a picture showing the errors that show up when trying to build on EmBitz.

Thanks in advance!

1 Like

This is an annoying side effect of Pokitto’s Arduino support.
You need to add #define DISABLEAVRMIN before you include Pokitto.h.

The problem comes from a conflict between the C++ library’s std::min and std:max which are template functions and the Arduino library’s min and max which are macros, and thus suffer from macro poisoning (a.k.a. macro bleed).
Essentially the macro versions end up everywhere so it’s upsetting the code that’s trying to use std::min and std::max.


One of my proposals for the future of the Pokitto library tackles exactly this problem

2 Likes

Thanks, that solved my issue! ^^

1 Like