The problem seems to be there is a min macro defined somewhere and when the compiler comes to the screenshot line, it thinks youâre using the macro, but itâs actually a function definition, so you should say you want to invalidate the macro somewhere before the compiler comes to this line.
I take it youâre trying to get one of your Arduboy games running?
If so which one(s)?
It might not run because the version of Arduboy2 packaged in Arduboy2Lib is out-of-date.
stl_algobase is a system file used to implement the standard library. @Xhaku canât alter that or they risk upsetting the standard library in general,
possibly causing knock-on effects with other games/programs.
This is the general answer, but it also depends on the program being compiled.
If that program needs the macro form of min and max then disabling the AVR compatibility will cause problems,
but at the same time not disabling it will prevent the algorithm standard header from compiling.
So basically itâs a bit of a âcatch-22â so we might need more details if using #define DISABLEAVRMIN doesnât work.
(In particular, where and why is #include <algorithm> occurring.)
I put #define DISABLEAVRMIN into My_settings.h for the built in hello world example and it works.
This solution doesent work for 101Starships_GB. I either get the same error or a new error where it says that min is not defined
Looks like the problem is that MinGWâs version of GCC 6.3.0âs version of the standard library is including algorithm in its stdint.h implementation for some reason.
âLegallyâ thatâs permitted, but rather awkward.
Checking my version of Code::Blocks, it seems Iâve got it set it to use 4.9.2 and that doesnât seem to be causing me issues.
@jonne, what version of GCC is your Code::Blocks using?
Thatâs exactly the âcatch-22â situation I mentioned earlier.
One way to fix that is to #define DISABLEAVRMIN in My_settings.h, and then at the top of the main file for 101Starships_GB (which Iâm assuming is called main.cpp), make sure you #include <Pokitto.h> first, and then right after that put:
While reading through the build log I noticed these three warnings:
C:UsersFlorimDesktopPokittoLib-masterPokittoLib-masterPokittoPOKITTO_COREPokittoCookie.cpp||In member function 'bool Pokitto::Cookie::saveCookie()':|
C:UsersFlorimDesktopPokittoLib-masterPokittoLib-masterPokittoPOKITTO_COREPokittoCookie.cpp|129|warning: control reaches end of non-void function [-Wreturn-type]|
C:UsersFlorimDesktopPokittoLib-masterPokittoLib-masterPokittoPOKITTO_COREPokittoCookie.cpp||In member function 'bool Pokitto::Cookie::loadCookie()':|
C:UsersFlorimDesktopPokittoLib-masterPokittoLib-masterPokittoPOKITTO_COREPokittoCookie.cpp|138|warning: control reaches end of non-void function [-Wreturn-type]|
C:UsersFlorimDesktopPokittoLib-masterPokittoLib-masterPokittoPOKITTO_COREPokittoCookie.cpp||In member function 'int Pokitto::Cookie::findMyNextBlock()':|
C:UsersFlorimDesktopPokittoLib-masterPokittoLib-masterPokittoPOKITTO_COREPokittoCookie.cpp|361|warning: control reaches end of non-void function [-Wreturn-type]|
I donât like warnings and these are potentially serious issues, so I made a PR to fix them:
i have removed the other compiler and installed 4.9.2.
The min max problem is gone however now i get another error.
I am trying to build the hello world example from the pokitto simlator.
Maybe you could take a look at it?
The problem seems to be this line
C:\Users\Florim\Desktop\PokittoLib-master\PokittoLib-master\Pokitto\POKITTO_CORE\PokittoConsole.cpp|83|error: cast from âchar*â to âuint32_t {aka unsigned int}â loses precision [-fpermissive]|
Iâm guessing thatâs because youâre compiling for a 64 bit CPU/OS so a pointer is 64 bits.
Iâll make a PR to the library tomorrow to fix that.
In the meantime you can try to set the compiler to compile a 32-bit program or you can pass the -fpermissive flag to the compiler through the build settings.
(And if you donât know how to do either of those, Iâll tell you tomorrow.)
i have tried to add -fpermissive which got rid of the error but then i got other errors which i think were also 64bit related so i removed the compiler again and installed the 32bit compiler.
Now everything seems to be working.
Thank you and Jonne for your help cant wait to get into the Pokitto especially the color display
Thanks I actually bought the Pokitto because of you. I was checking out your raycastLib and saw a gif of an example on the Pokitto. For some reason that was enough for me to buy it.
This means very much to me, Iâm really very happy you liked it so much.
Until the Pokitto arrives, also try out the emulator:
I now prefer it to the simulator for the development because it behaves more like the actual hardware. I still use the simulator for debugging (with that you can normally print to console, use valgrind on the executable etc.).