Error exit status 1 upload on some games

I have a homemade aruboy using Arduino pro micro and I am using Mr.Blinky homemade package. Some games don’t work and give this error message

C:\Users\morte\Downloads\LodeRunner-1.04\LodeRunner\src\utils\Arduboy2Ext.cpp: In member function ‘void Arduboy2Ext::drawCompressedMirror(int16_t, int16_t, const uint8_t*, uint8_t, bool)’:
C:\Users\morte\Downloads\LodeRunner-1.04\LodeRunner\src\utils\Arduboy2Ext.cpp:60:19: error: variable ‘Arduboy2Base::BitStreamReader cs’ has initializer but incomplete type
BitStreamReader cs = BitStreamReader(bitmap);
^~
C:\Users\morte\Downloads\LodeRunner-1.04\LodeRunner\src\utils\Arduboy2Ext.cpp:60:46: error: invalid use of incomplete type ‘struct Arduboy2Base::BitStreamReader’
BitStreamReader cs = BitStreamReader(bitmap);
^
In file included from C:\Users\morte\Downloads\LodeRunner-1.04\LodeRunner\src\utils\Arduboy2Ext.h:3:0,
from C:\Users\morte\Downloads\LodeRunner-1.04\LodeRunner\src\utils\Arduboy2Ext.cpp:1:
C:\Users\morte\AppData\Local\Arduino15\packages\arduboy-homemade\hardware\avr\1.3.4\libraries\Arduboy2\src/Arduboy2.h:1512:10: note: forward declaration of ‘struct Arduboy2Base::BitStreamReader’
struct BitStreamReader;
^~~~~~~~~~~~~~~
exit status 1
Error compiling for board Homemade Arduboy.

this does not happen to any team arg games but happen to some games like Evade,Evade2,Lode runner,Dark and under(this happens when I use the homemade package version of the game but when I download the normal version it works)
The Lode runner doesn’t work but if I use the Fx version it uploads and works a bit then crashes

Looks like some games that use their own library functions are causing a collision with @Mr.Blinky oard package?

I’ve downloaded loderunner from here and compiled it with Arduino IDE 1.8.19 and Homemade package version 1.3.4 and didn’t run into any compile issues.
What if you use the same source, what Arduino IDE do you use and what settings (board,display,core,etc)? If not what source did you use?


Also have you installed the Arduboy2 library manually or through the library manager?
If you have remove it from the sketchbook/library folder

I have actually had this error myself and was able to fix it with the help of @pharap. His response to my question is below

The actual problem is that when you mention BitStreamReader in the function, it’s trying to use Arduboy2Base::BitStreamReader which is only declared in Arduboy2.h, so it can’t be instantiated.
(Arduboy2Base::BitStreamReader is only defined in Arduboy2.cpp, which your code can’t see.)

The BitStreamReader you’re defining isn’t a definition for the one declared as part of Arduboy2Base, it’s a definition for one in the global namespace.

Thus you have two options…

Option 1:
Make your definition a definition for Arduboy2Base::BitStreamReader instead of a BitStreamReader in the global namespace.

struct Arduboy2Base::BitStreamReader {

Option 2:
Specify that you want the one from the global namespace.

::BitStreamReader cs = ::BitStreamReader(bitmap);


I think I’m going to mention this to MLXXXp because I don’t think this is the intended behaviour. BitStreamReader should either be private instead of protected or actually defined in the header file.

I actually chose option 1 and it worked for me.

2 Likes

I suspect I completely forgot to do that…

@MLXXXp, do you recall me mentioning it?


I’m not sure why these particular games are actually using BitStreamReader though.

I knew @filmote had used it for some reason, so I’m not surprised that Lode Runner and Dark and Under are in the list, but I had no idea Evade and Evade 2 were using them.

1 Like

I hacked the graphics library to include a sprite mirroring function. I had run out of space again!

I wonder if they are doing the same thing I am?

Yes, we had a PM discussion about it. It should still be available to you for viewing.

The decision was to make BitStreamReader private, as well as a number of helper functions that were deemed to be for internal library use only. Unfortunately, I haven’t gotten around to making these changes and releasing a new version of the library. (There are a few other small changes that I’d like to include, as well.)

I’ve added @filmote and @Mr.Blinky to that private discussion, for their reference.

1 Like

@dunno, can you verify whether you get the same error message for each game or whether they provide different error messages?

And if you aren’t sure, just post all the errors you get and we’ll take a look at them.

Note that ‘exit status 1’ only says that the compilation failed, it doesn’t explain why. It’s all that other text that explains the problem.


Just to check, did you update the repo?
If not, an update might help here.
(Though read on to the end of this post before you do…)

Quelle surprise. :P

I’ve checked. BitStreamReader isn’t mentioned at all in the source.

I suspect the errors @dunno is getting for Evade and Evade 2 are in fact unrelated to the error LodeRunner produces.

In which case, I suspect the Dark and Under error could also be a different issue.


Ah yes, I’ve found it now, back in February.
I couldn’t remember and didn’t have time to check, but now I vaguely remember the discussion.

In which case, @filmote may need to revisit that code after the next library update and opt for the other proposed solution.

1 Like

I’ve deleted the library from the sketchbook and using the included library that’s part of the package.
And the settings are
based on: pro micro 5v-standard wiring
core: optimized
display: SH1106 i2c display
bootloader: cathy 3k
and I am using the same version of the IDE that are

The error fro Evade is different :

In file included from C:\Users\morte\Downloads\evade-arduboy-game-develop\evade-arduboy-game-develop\arduboy-game\bullet.h:11:0,
from C:\Users\morte\Downloads\evade-arduboy-game-develop\evade-arduboy-game-develop\arduboy-game\arduboy-game.ino:18:
bitmaps.h:299:2: error: #endif without #if
#endif
^~~~~
In file included from C:\Users\morte\Downloads\evade-arduboy-game-develop\evade-arduboy-game-develop\arduboy-game\enemy.h:11:0,
from C:\Users\morte\Downloads\evade-arduboy-game-develop\evade-arduboy-game-develop\arduboy-game\arduboy-game.ino:19:
bitmaps.h:299:2: error: #endif without #if*
#endif
^~~~~
In file included from C:\Users\morte\Downloads\evade-arduboy-game-develop\evade-arduboy-game-develop\arduboy-game\arduboy-game.ino:20:0:
bitmaps.h:299:2: error: #endif without #if
#endif
^~~~~
exit status 1
#endif without #if

the error for evade2 is very different :

wiring.c.o (symbol from plugin): In function micros': (.text+0x0): multiple definition of micros’
sketch\src\ArduinoCore\wiring.c.o (symbol from plugin):(.text+0x0): first defined here
wiring.c.o (symbol from plugin): In function micros': (.text+0x0): multiple definition of timer0_overflow_count’
sketch\src\ArduinoCore\wiring.c.o (symbol from plugin):(.text+0x0): first defined here
wiring.c.o (symbol from plugin): In function micros': (.text+0x0): multiple definition of __vector_23’
sketch\src\ArduinoCore\wiring.c.o (symbol from plugin):(.text+0x0): first defined here
wiring.c.o (symbol from plugin): In function micros': (.text+0x0): multiple definition of timer0_millis’
sketch\src\ArduinoCore\wiring.c.o (symbol from plugin):(.text+0x0): first defined here
wiring.c.o (symbol from plugin): In function micros': (.text+0x0): multiple definition of millis’
sketch\src\ArduinoCore\wiring.c.o (symbol from plugin):(.text+0x0): first defined here
wiring.c.o (symbol from plugin): In function micros': (.text+0x0): multiple definition of delay’
sketch\src\ArduinoCore\wiring.c.o (symbol from plugin):(.text+0x0): first defined here
wiring.c.o (symbol from plugin): In function micros': (.text+0x0): multiple definition of delayMicroseconds’
sketch\src\ArduinoCore\wiring.c.o (symbol from plugin):(.text+0x0): first defined here
wiring.c.o (symbol from plugin): In function micros': (.text+0x0): multiple definition of init’
sketch\src\ArduinoCore\wiring.c.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Homemade Arduboy.

the error for dark and under clone version (note that the actual main version works for me so I dont realy care about this being fixed):

C:\Users\morte\Downloads\Dark-And-Under-For-Clones-master\Dark-And-Under-For-Clones-master\Dark-And-Under\src\Arduboy\Arduboy2.cpp: In member function ‘bool Arduboy2Base::nextFrame()’:
C:\Users\morte\Downloads\Dark-And-Under-For-Clones-master\Dark-And-Under-For-Clones-master\Dark-And-Under\src\Arduboy\Arduboy2.cpp:235:17: error: ‘millisChar’ was not declared in this scope
uint8_t now = millisChar();
^~~~~~~~~~
C:\Users\morte\Downloads\Dark-And-Under-For-Clones-master\Dark-And-Under-For-Clones-master\Dark-And-Under\src\Arduboy\Arduboy2.cpp:235:17: note: suggested alternative: ‘millis’
uint8_t now = millisChar();
^~~~~~~~~~
millis
exit status 1
Error compiling for board Homemade Arduboy.

so the error are all different and have nothing in common

And I have downloaded the code from that link and it works so I don;t know why the code linked in games page is different to that one

Evade 2 uses a custom version of wiring.c. for succesful compilation:

  1. Select standard Arduino core
    or
  2. Remove the wiring.c file from the Evade 2 source.

with 1st option you need to press UP+LEFT+A+B for 2 seconds to reset to bootloader mode.

Wiith the 2nd option you can press UP+DOWN for 2 seconds to reset to bootloader. (this is recommended option)

For the option 1 and 2 are you referring to Fimote’s 1st post

No.

With Evade 2 a custom wiring.c (an arduino core file) file was added to allow an easy way to reset into bootloader mode using a keycombo as the USB code was removed to save space.

The Arduboy Optimized core also adds a custom wiring.c for optimisation and an easier button combo to enter bootloader mode (UP+DOWN).

When compiling Evade 2 two wiring .c files are found and cause the error. Using the sugested options will make sure ony one wiring.c file is used for compiling.

okay thanks