Cannot find Gameduino2 header files

I am trying to take over an Arduino project that someone else did. I know it used Gameduino2 so i added it to the platformio.ini:

[env:release]
platform = atmelsam
board = due
framework = arduino
lib_ldf_mode = deep
lib_extra_dirs = ../../libs, ../../external
lib_deps = 
	greiman/SdFat @ ^2.1.2
	mbed-aluqard/Gameduino2@0.0.0+sha.9c211972beb2
monitor_speed = 115200

When i do “pio run -e release” i get

In file included from src/BingMachine.h:11:0,
from src/BingMachine.cpp:1:
src/BingMachineV3.h:8:10: fatal error: GD2.h: No such file or directory

all Gameduino options use Mbed framework, but project was in Arduino framework. Has this changed? could this be the problem?

I also tried installing the library from the PlaformIO IDE

In fact in libdeps/release/Gameduino2/ are the GD2.h .cpp files

Are you sure you don’t want to use GitHub - jamesbowman/gd2-lib: Gameduino 2/3/3X library sources instead of PlatformIO Registry?

I’ve looked at it but i don’t understand how it integrates with the code that uses a GD2.h functions. I’m totally new to Arduino. You think there is an incompatibility with de PlatformIO Registry option?

Well it definitely has the GD2.h header file that you seem to need and is based on Arduino instead of mbed-os. Mbed-os is an entirely different framework to Arduino, you usually can’t use mbed-os libraries in an Arduino project (as soon as they need anything from mbed-os)

Try replacing the mbed-aluqard/Gameduino2@0.0.0+sha.9c211972beb2 with https://github.com/jamesbowman/gd2-lib/archive/refs/heads/master.zip. (The library is not registered with the PlatformIO registry yet). Do you get further?

Worked! i Got further but i stumbled into a chain of Adafruit dependencies, and after installing every single one i am having other SDFat issued. But in fact, i needed to use arduino compatible option to get GD2 working so i’m marking it as a solution. I will start another discussion if i need to.

Thanks a bunch!!

1 Like

Hello!

Is there a chance to access earlier versions of gd2-lib?

As documented in Redirecting..., you can put a #<commit hash or tag name> behind the .git link of the repo to get a specific version. Or point to a different Zip file that is not master.zip.

Looking at the gd2-lib repo though, there are no version tags (bad development habits), so the best you can do is look in the commit history (Commits · jamesbowman/gd2-lib · GitHub) and pick a state you need. For example

lib_deps =
   https://github.com/jamesbowman/gd2-lib.git#88b0ee2a4fc8fa9497696d772feb5235b4c310c3
1 Like

Ah, looking at the “version” file you can actually look at the commit-history of that file and get to the commit hash for a specific version.

For example, f5e6bbe1219e2bb7c9a19467ccd53993d5306a06 for v1.1.1.

Thank you, i’ll surely be needing this information because this project has many libraries and i will probably need to have the exact one they used originally.

Nonetheless, the reason i asked was regarding this issue that i just posted