Error when compiling for simulator

Another familiar face I see. :P

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 just downloaded the Pokitto_sim and tried to build it and run the built in hello world example.
I have not changed a thing

@Xhaku : Pokitto_sim is deprecated. Use this instead:

The sim part with its .cdb (code::blocks) project file is under the POKITTO_SIM folder

Yes this is the tutorial i originally followed and where i got the error

Aha… let me check nothing is the matter. There should not be any errors.

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

I just pulled the repo and built the HelloWorld with no changes: 0 errors. Windows 10, Code::Blocks 16.01

EDIT: you have 17.12 … that may affect the result.

Let me install 17.12 and check on another machine

What OS are you on? edit: nevermind, i looked at the pic :laughing:

@Xhaku :

I just cloned the repo again, and built the HelloWorld target with a fresh Code::Blocks 17.12 installation, no problems at all

Please copy paste your entire build log here so I can take a look at it

1 Like

my build log is right here
this is when i tried to build for the 101Starships_GB

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:

#define max(x, y) ((x) > (y) ? (x) : (y))
#define min(x, y) ((x) < (y) ? (x) : (y))

It’s not ideal, but it should work.


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]|

the full log is here

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

1 Like

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 :slight_smile:


BTW nice to see you here :slight_smile: Loved your Arduboy games, can’t wait for what you do with Pokitto.


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

EDIT: Apparently emulator now supports printf too :slight_smile:

1 Like

I see you haven’t updated in a while. :stuck_out_tongue:
(you can also print to console with the emulator on Linux)

1 Like

Hmmm let me check :smiley:


Yeah, works like a charm (not that I didn’t trust you :smiley:)

BTW I needed to add OBJECTS += BUILD/loadBin.o to the Makefile.

1 Like

Oops, thanks for the heads up. My last commit was done on Windows and I use codeblocks for that instead of make. Fixed it now. :slight_smile:

Edit: Now I have to figure out how to make the console work on Windows. >_<