This page provides setup instructions for the software team's tools so members can quickly start learning C++. Please install 64-bit versions of tools if possible and make sure the bitness of all your tools matches by using the appropriate archives/installers.
sudo apt-get install openjdk-8-jdk
Download the Eclipse IDE for C/C++ Developers. Once the download is complete, extract it to a directory of your choice.
sudo apt-get install gcc
sudo apt-get install git
sudo apt-get install clang-format python3-pip pip3 install --user wpiformat
Arch Linux installation
sudo pacman -S jdk8-openjdk eclipse-cpp
sudo pacman -S gcc
sudo pacman -S git
This requires a package from the AUR. Use either the manual installation method (shown below) or an AUR helper.
sudo pacman -S python cd /tmp git clone https://aur.archlinux.org/python-wpiformat-git makepkg -si
Download the JDK 8 installer from here and run it.
Download the Eclipse IDE for C/C++ Developers, then extract it to a directory of your choice.
- Download the MSYS2 installer from here and run it. Use the default installation directory.
pacman -Syu, then close all terminals when directed to do so.
- Add MSYS2 to your system-wide PATH environment variable.
- 32-bit path: "C:\msys32\usr\bin"
- 64-bit path: "C:\msys64\usr\bin"
- Create a desktop shortcut for "MSYS2 MSYS" if desired.
pacman -S --needed base-devel gcc, then when prompted for which packages in the base-devel group to install, press Enter to select the default option (all of them).
pacman -S git
Download the latest version of LLVM from here under "Pre-Built Binaries" and run it. The default installation options are fine. Don't worry if you see the following; it's irrelevant to our use.
Installing MSVC integration... Failed to find MSBuild toolsets directory. MSVC integration install failed.
MSYS2 keeps a separate PATH environment variable from the operating system. Run the following command to add the LLVM installation to it.
echo 'export PATH=$PATH:/c/Program\ Files/LLVM/bin' >> ~/.bashrc
The following commands install Python and pip, then use pip to install wpiformat.
pacman -S python wget https://bootstrap.pypa.io/get-pip.py python get-pip.py pip install wpiformat
After those commands complete, close and reopen the terminal so the PATH environment variable change from earlier takes effect.
Eclipse CDT is an integrated development environment which makes it easier to write, build, and test programs written in C and C++.
New project toolchain selection
On Linux, use "Linux GCC". On Windows, use "Cygwin GCC".
Eclipse occasionally shows outdated or false errors in a project file. If this is the case, the project's index needs to be rebuilt. To do so, select the following option.
Right-click project > Index > Rebuild
Keep in mind errors shown in the IDE aren't authoritative. The console build output should be used to determine whether the executable was built successfully.
To configure a project to build with C++14, select "ISOC++1y" from the "Language standard" drop-down menu in the following location.
Right-click project > Properties > C/C++ Build > Settings > GCC C++ Compiler > Dialect
This is the compiler Eclipse CDT will use to build the programs you write. MSYS2 provides a Linux-like environment with this compiler.
Git is a version control system used to manage the code you write. See Git 1 for more information and detailed setup.
Formatters help ensure style guide conformance by automatically correcting deviations. We use the Python 3 scripts provided in WPILib's style guide repository and clang-format for source code formatting. We also use Python 3 for optimizing feedback control system behavior.
Note: The formatter should be considered a safety net. It is good practice to be familiar with the enforced style guide and be able to write code in that style directly.