{"id":13504733,"url":"https://github.com/ddemidov/ev3dev-lang-cpp","last_synced_at":"2025-10-08T11:56:57.719Z","repository":{"id":51835241,"uuid":"48567832","full_name":"ddemidov/ev3dev-lang-cpp","owner":"ddemidov","description":"C++ language bindings for http://ev3dev.org","archived":false,"fork":false,"pushed_at":"2022-11-23T02:17:06.000Z","size":448,"stargazers_count":73,"open_issues_count":16,"forks_count":38,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-02-27T15:31:48.668Z","etag":null,"topics":["cpp","ev3dev","lego","mindstorms"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddemidov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-25T05:31:59.000Z","updated_at":"2024-08-24T12:05:39.000Z","dependencies_parsed_at":"2022-08-23T08:41:25.724Z","dependency_job_id":null,"html_url":"https://github.com/ddemidov/ev3dev-lang-cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddemidov%2Fev3dev-lang-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddemidov%2Fev3dev-lang-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddemidov%2Fev3dev-lang-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddemidov%2Fev3dev-lang-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddemidov","download_url":"https://codeload.github.com/ddemidov/ev3dev-lang-cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243835942,"owners_count":20355611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","ev3dev","lego","mindstorms"],"created_at":"2024-08-01T00:00:50.498Z","updated_at":"2025-10-08T11:56:52.699Z","avatar_url":"https://github.com/ddemidov.png","language":"C++","readme":"# C++ language bindings for ev3dev\n\n[![Build Status](https://travis-ci.org/ddemidov/ev3dev-lang-cpp.svg?branch=master)](https://travis-ci.org/ddemidov/ev3dev-lang-cpp)\n\n## Compiling\n\n* EV3:\n```\nmkdir build\ncd build\ncmake .. -DEV3DEV_PLATFORM=EV3\nmake\n```\n\n* BrickPi:\n```\nmkdir build\ncd build\ncmake .. -DEV3DEV_PLATFORM=RPI\nmake\n```\n\nYou have several options for compiling.\n\n## Cross-compiling\n\nYou can use a cross-compiling toolchain to create ARM compatible code. Note:\nYou need a Linux toolchain, not a \"bare-metal\" toolchain. If it does not have\n\"linux\" in the name, it probably won't work.\n\nPros: Fastest option. Works on Windows and Mac without a virtual machine.\n\nCons: Only includes standard libraries - no Debian `-dev` packages.\n\n### Windows\n\n[MentorGraphics toolchain](http://sourcery.mentor.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.exe) (formerly known as CodeSourcery).\n\n### Windows 10\n\nWindows 10 supports the Windows Subsystem for Linux which allows us to install and execute the entire compiler toolchain. The steps required to compile native-mode EV3 applications on Windows 10 is as follows:\n\n1. Be sure that your Windows 10 installation has Windows Subsystem for Linux installed. First make sure Developer Mode is enabled under Settings --\u003e Update \u0026 Security --\u003e For developers. Then, go to Control Panel --\u003e Programs and Features --\u003e Turn Windows Feature On/Off and check the box next to Windows Subsystem for Linux (Beta).\n\n2. Fire up the bash shell by pressing Start Key, type `bash` and press `Enter`. This will open up Bash on Ubuntu on Windows.\n\n3. Install the ARM compiler by typing `sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi`.\n\n4. Use `git clone` to clone this repository to the directory of your choice, e.g.,\n\n```sh\ngit clone https://github.com/ddemidov/ev3dev-lang-cpp.git\n```\n\nwill clone the repo into a directory called `/ev3dev-lang-cpp.git`.\n\n5. You need to make some changes to the top-level `CMakeLists.txt` file. First, go into the directory\n\n```sh\ncd ev3dev-lang-cpp\n```\nNow, edit the `CMakeLists.txt` file with a text editor of your choice, e.g.,\n\n```sh\nvi CMakeLists.txt\n```\n\nJust after the `project(...)` declaration, set the C/C++ compilers by adding the following lines:\n\n```cmake\nset(CMAKE_C_COMPILER \"arm-linux-gnueabi-gcc\")\nset(CMAKE_CC_COMPILER \"arm-linux-gnueabi-gcc\")\nset(CMAKE_CXX_COMPILER \"arm-linux-gnueabi-g++\")\n```\n\nAlternatively, you can set these environment variables during compilation (explained later).\n\n6. Now compile your programs and the generated binaries will be ready for EV3. This assumes that you have build tools such as `make` and `cmake` installed - if not, install them with `sudo apt-get install build-essential` (for make) and `sudo apt-get install cmake` for cmake. You can then perform compilation by invoking the following commands:\n\n```sh\nmkdir build \u0026\u0026 cd build\ncmake .. -DEV3DEV_PLATFORM=EV3\nmake\n```\n\nIf you did not set the variables in the `CMakeLists.txt` file, use the following commands instead:\n\n```sh\nmkdir build \u0026\u0026 cd build\nCC=arm-linux-gnueabi-gcc CXX=arm-linux-gnueabi-g++ cmake ..\nmake\n```\n\n7. Install `gcc-5` from `unstable` on your EV3, or else files compiled in Windows will not execute. First, on the EV3, edit `/etc/apt/sources.list` to allow searching for packages in `unstable`:\n\n```\nsudo vim /etc/apt/sources.list\n```\nAppend the following lines to the end of the file:\n```\ndeb http://httpredir.debian.org/debian unstable main contrib non-free\ndeb http://security.debian.org/ unstable/updates main contrib non-free\ndeb http://archive.ev3dev.org/debian unstable main\n```\n\nSave and exit. Afterwards, run `sudo apt-get update`, which will update the packages searched for. Finally, install the new gcc compiler:\n\n```\nsudo apt-get install gcc-5/unstable\n```\n\n8. The `build` directory will now contain folders with binary files ready to be executed on the EV3 brick. The easiest way to copy files is to use a program that supports SFTP, such as Filezilla. Remember that, by default, the username of the host system is `robot` and password is `maker`. The location of the path where the files are kept on disk is likely the following:\n\n```\nc:\\users\\\u003cYOUR USERNAME\u003e\\appdata\\local\\lxss\\home\\\u003cYOUR USERNAME\u003e\\ev3dev-lang-cpp\\build\\\n```\n\nAlternatively, Secure Copy may be used to quickly transfer a few files without having to leave the shell:\n\n```\nscp file.txt \u003cEV3 USERNAME\u003e@\u003cIP\u003e:/destination/directory\n```\n\n9. Be sure to `chmod u+x myprogram` for every copied program before running the program, otherwise you'll get an `Access Denied` in SSH or some really weird error if executing from the brick.\n\n### Mac\n\nThe\n[Carlson-Minot toolchain](http://www.carlson-minot.com/available-arm-gnu-linux-g-lite-builds-for-mac-os-x/mac-os-x-arm-gnu-linux-g-lite-201405-29-toolchain)\nprovides a complete toolchain for cross-compilation on the Mac. Download the \"ARM GNU/Linux G++ Lite 2014.05-29 Easy Installer\" and run it.\n\nTo get the cross-compilation working, use (replace EV3 by RPI for the BrickPi)\n```\nmkdir build\ncd build\nCC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++  cmake -DCMAKE_SYSTEM_NAME=Linux -DEV3DEV_PLATFORM=EV3 ..\nmake\n```\n\n## Brickstrap\n\nBrickstrap uses QEMU to create a virtual environment (not exactly a virtual\nmachine) that can run the same ARM compatible code on a different type of\ncomputer.\n\nPros: Faster than running on the EV3 itself. Can install all Debian `-dev`\npackages using `apt-get`.\n\nCons: Slower than cross-compiler. Requires Linux (Ubuntu).\n\nSee [this page](https://github.com/ev3dev/ev3dev/wiki/Using-brickstrap-to-cross-compile-and-debug) for instructions.\n\n\n## On the Brick\n\nIt is possible to compile programs on the EV3 brick itself.\n\nPros: Easy to setup.\n\nCons: Really slow.\n\nJust run `sudo apt-get install build-essential` on the EV3 and you will have\neverything you need.\n","funding_links":[],"categories":["EV3"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddemidov%2Fev3dev-lang-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddemidov%2Fev3dev-lang-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddemidov%2Fev3dev-lang-cpp/lists"}