openFrameworks | Documentation table of contents

msys2

Installing MSYS2

Download link and instructionss can be found on the MSYS2 web site. Several installers (self extracting archive, XZ archive) are available; any will work with openFrameworks.

Install MSYS2 in the default folder, C:\msys64, unless you know you need another path. Qt Creator is no longer a maintained setup. Use VS Code.

Updating MSYS2

openFrameworks expects an up-to-date installation of MSYS2. As MSYS2 is a rolling-release distribution, even the latest installer may be out-of-date!

To update your MSYS2 installation, from any MSYS2 shell (MSYS2, MINGW64, UCRT64, ...), run :

pacman -Syu --noconfirm --needed

Depending on the packages to be updated, you may need to close the shell and run the previous command again.

If your installation hasn't been updated in a few months, you may encounter additional problems. Instructions on the Updating MSYS2 page may help solve them.

You are now ready to install openFrameworks.

Installing openFrameworks

IMPORTANT MSYS2 comes in many flavors : MSYS2 (msys2.exe), MINGW32 (mingw32.exe), MINGW64 (mingw64.exe), CLANG32 (clang32.exe), CLANG64 (clang64.exe), CLANGARM64 (clangarm64.exe) and UCRT64 (ucrt64.exe). Each flavor has its shell launcher in MSYS2 installation folder. This really important to remember as lots of problem with running openFrameworks with MSYS2 come from using the wrong flavor/shell.

0.12.1 publishes three 64-bit MSYS2 packages. Open the shell that matches the zip. The stable files are on the 0.12.1 release. Nightly names are dated and listed on the nightly release.

Shell 0.12.1 package
MINGW64 (C:\msys64\mingw64.exe) of_v0.12.1_msys2_mingw64_release.zip
UCRT64 (C:\msys64\ucrt64.exe) of_v0.12.1_msys2_ucrt64_release.zip
CLANG64 (C:\msys64\clang64.exe) of_v0.12.1_msys2_clang64_release.zip

MINGW64 is the default if you do not have a reason to pick another. Nightly builds also include a CLANGARM64 package.

For the following instructions, it assumed that MSYS2 is installed in C:\msys64. If it has been installed elsewhere, adapt the instructions to reflect your MSYS2 installation path.

DO NOT INSTALL oF in a folder containing a space or other special characters.

Open the matching shell and install openFrameworks dependencies:

cd your_oF_directory/scripts/msys2
./install_dependencies.sh --noconfirm

Next, compile openFrameworks libraries:

cd your_oF_directory/libs/openFrameworksCompiled/project
make

You can speed up compilation using make -j4 (or the number of cores you want it to use) for a parallel build.

Checking OF installation by running examples

Compiling and running an OF example in the best way to check if you're ready for it.

To compile an example (e.x. the 3DPrimitivesExample), run:

cd your_oF_directory/examples/3d/3DPrimitivesExample
make

At this point, make run should execute the newly built example.

However, it wil not execute by double-clicking on its icon; lots of "missing DLL" warnings will appear. To fix these, you need to copy the required DLLs file in the application folder with the make copy_dlls command.

Setting up an IDE

Several IDEs can be used with MSYS2. QT Creator used to be OF recommended choice, but as of late VS Code has gained popularity and is now used by many OF enthusiasts.

If you use a different IDE and would like to share your knowledge in setting it up for OF development, do not hesitate to contribute to this page.

VS Code

You can find more information in the corresponding setup guide:

QT Creator

You can find more information in the corresponding setup guide:

As mention earlier, pay attention to the installation folder of MSYS2 (which must be C:\msys64).

Makefile

Every example has a Makefile you can configure using the files config.make and addons.make.

config.make: This file has options to add search paths, libraries, etc. The syntax is the usual Makefile syntax; there's comments inside the file to help with organization.

addons.make: if you want to use an addon which is inside the addons folder, justadd its name in a new line in this file.

FAQ / Common problems

  • "How to set up the PATH variable?"

Unless you know exactly what you are doing, YOU SHOULD NOT set the PATH variable. The main cause of openFrameworks application crashes on MSYS2 is DLL incompatibilities. This is because, when the DLL is not in the same folder as the application executable, the OF application looks for it in the PATH. It may find DLL with the right name but with a different MSYS2 flavor (MINGW32 vs MINGW64) or from a non-MSYS2 location (for example a separate OpenSSL installation).

Use the make copy_dlls command to make sure that the MSYS2 DLLs are copied next to the executable. This will also ease the installation of the application on a different computer, because you can just copy the executable & all DLLs together.

You may be tempted to set MSYS2 in the path to enable the automatic detection of compiler installation by IDE software. It's an easy way to setup up your IDE. However, there may also be some settings in the IDE to configure where to find the programs. That gives you better control. As stated earlier, relying on the PATH variable to find the programs may result in unexpected behaviours (for example, using Windows C:\Windows\System32\find.exe instead of MSYS C:\msys64\usr\bin\find.exe)

It may be helpful to write a wrapper batch file to lauch your IDE where you set the PATH to use for just that program. This way you do not pollute your PATH system-wide.

  • "Are UCRT64, CLANG64 and others MSYS2 flavors supported?"

Yes, when you download the matching release zip and open the matching shell. 0.12.1 ships MINGW64, UCRT64, and CLANG64. Nightly also ships CLANGARM64. Do not mix libraries from one shell with a compiler from another.

  • "I have a 'TLSv1_1_client_method missing error' when I double-click the exe?"

This happens when the executable looks for ssleay32.dll and libeay32.dll and it first finds a version that doesn't support TLS v1.1. Often it happens with Intel iCls software. The solution is to move the your_msys2_directory\mingw64\bin path before the conflicting path. If the conflicting path is in the system PATH and you do not have administrative privileges, copy/link ssleay32.dll and libeay32.dll from your_msys2_directory\mingw64\bin to the executable folder.

  • "I'm on a corporate network and I cannot install OF dependencies, update MSYS2..."

This is more an MSYS2 problem than an OF problem. Ask your system adminsitrator for help as the reasons are multiple (proxy,certificates,...)

You may need to set HTTP_PROXY and HTTPS_PROXY environment variables. From a DOS/CMD prompt:

set http_proxy=http://your_proxy:your_port
set http_proxy=http://username:password@your_proxy:your_port
set https_proxy=https://your_proxy:your_port
set https_proxy=https://username:password@your_proxy:your_port

Don't forget to escape special characters in your password...

many thanks!! OFteam