Attempting to create an text-based RPG for the playdate using c++.
I work with this either with Terminal or CLion
Add execution permission to bootstrap with chmod +x bootstrap.sh, and launch it. Then choose the option that works for you.
- Open the project in CLion
- Open Run/Debug Configurations
- Add a new configuration
- Name: CardoBlast
- Target: CardoBlast
- Executable: (~/Developer/PlaydateSDK/bin/Playdate Simulator.app/Contents/MacOS/Playdate Simulator)
- Program arguments: /CardoBlast.pdx
- Go to Clion Preferences -> Build, Execution, Deployment -> CMake
- Add two profiles
- "Simulator"
- Name: Simulator
- Build type: Debug
- CMake options: -DPROJECT_NAME=CardoBlast
- Build directory: /build/simulator
- "Device"
- Name: Simulator
- Build type: Debug
- CMake options: -DPROJECT_NAME="CardoBlast" -DCMAKE_TOOLCHAIN_FILE=/Users/sergio.prada/Developer/PlaydateSDK/C_API/buildsupport/arm.cmake
- Build directory: /build/device
This repository incorporates the submodule playdate-cpp. Please refer to its README for guidance on configuration and setup. This project has been developed and tested on a Mac M1, running Sonoma 14.15.
- PLaydate SDK path Environment variable is required!
Problem Description:
When compiling, you might encounter a linker error similar to the following:
ld: error: .data has both ordered ['.ARM.exidx.text.__aeabi_atexit' ...] and unordered ['.data.__atexit_recursive_mutex' ...] sections.
This issue is discussed in detail in this Playdate Developer Forum thread.
Solution:
The resolution involves updating to the latest ARM toolchain and creating symbolic links in /usr/local/bin
. This solution is based on the advice provided in this forum post.
To apply the fix, execute the following command in the Terminal:
sudo ln -sf /Applications/ARM/bin/* /usr/local/bin
This command creates symbolic links for the ARM toolchain binaries in /usr/local/bin, ensuring that the build process can correctly locate and use these tools.