Better setup process
There is now a template available for github codespaces. Select Use this template -> Open in a codespace from this template repository
Please note that the rest of the documentation was written before Github Codespaces are released. Because of this, there is no mention of github codespaces anywhere else in the documentation. If you have a problem with the github codespaces setup, contact
yuetlongfeng@gmail.com
Introduction
If you do not know what ev3dev is, go here. This library is a wrapper around ev3dev’s official cpp library. We do not guarantee that this wrapper will work. We currently only have support for compiling on windows. (MacOS support not coming soon)
Prerequisites
- Basic Git Usage
- Basic C++ Knowledge
- An Idea of what CMake is
Required installations
- Docker
- Git
Note that CMake is not required to be installed on your machine, since it is actually installed within the Docker image
Quick start - Installation
OS: Windows
This installation guide assumes that you are using V2.5.0 of the library
- Clone the repository
- open up command prompt
- open up file explorer
- go to the folder where you would like to install the repository
- Click on the folder path and copy it to the clipboard, as demonstrated like this

- Type
cd <paste clipboard file path here>
- Hit Enter and execute the command
- type
git clone --recursive https://github.com/rshs-robotics-club/ev3dev-cpp-wrapper-example.gitinto the command prompt - Hit Enter and execute the command
- The repository should now be cloned into that folder.
- Your first compilation
- You are now ready for compiling the library. Open the cloned repository folder with your favorite code editor. (e.g. Visual Studio Code)
- Turn on docker desktop. This will turn on the docker daemon (a background task) that we require for cross compiling.
- run
dockersetup.shby double clicking the file, or by running./scripts/compile.shin the repository directory It should be stored inside thescriptsfolder. This will install the Docker image for the ev3 robot.Warning: the Docker image is more than 1GB and is quite large, so make sure there is space on your computer
- run
./scripts/compile.shwithin the repository directory. The library should now begin compiling
- Using the library regularly
- The
srcfolder inside the repository is where your source code should be placed. - Start your first project by creating
projectName.cppin that folder - create a
main()function just like a normal c++ program - run
./scripts/compile.shand the project should be compiled - you can find the output
.elffiles in thebinfolder. Note that linux (ev3dev) does not care about file extensions, but since we’re using windows we make it easier for ourselves by distinguishing executables with the.elfextension. - If you want to create more executables/projects, you can do so by creating a new
differentprojectName.cppfile and running./scripts/compile.shagain. Now, you will find bothprojectName.elfanddifferentprojectName.elfin thebinfolder. This is useful when you require quick prototyping in your project.Oh no! I ran into a problem
See the troubleshooting section (Not implemented yet) for solutions to common problems. If you can’t find any, check issues. If you still can’t find a solution, open a new issue and we will try to help you.
- The