Compiling an OF 0.9.8 project on Windows 10

Hi all,

I’ve been using OF for years on MacOS, but now I want to compile an existing project on Windows 10. I haven’t used Windows for a long, so please can you recommend the best way.

The project is built in OF 0.9.8 (and works happily in MacOS).
To compile it on Windows 10, should I be using visual studio (version 2017 or 2019?) or qtcreator or msys2 (which flavor?). I’ve never used any of these tools before so would prefer the easiest route if possible!

Thanks for any advice.
Best,
Paul

Msys2 is just a driver(or required libs) you need anyway, to build OF projects on QtCreator, but also you can build without Qt (then you have to built it from console using msys2 and mingw32 or mingw64 respectively).
Understand that for Windows the officially supported IDEs are only Visual Studio or QtCreator. I’d recommend using either VS or QtCreator for just development.
When you’re sure you can finalize your project, if I were you, I’d build it with msys2 via console and then run command make copy_dlls - this way, your compiled project should be able to run on any windows computer - you’ll find the instructions in msys2 setup guide https://openframeworks.cc/setup/msys2/.

However, I recommend using some Unix-based or Unix-like system instead, like some Linux distro - either on another computer or making a dual boot (you’ll be using QtCreator there) - especially if you’re considering using Windows 10 and you plan to do a lot of dynamic allocation, using pointers, release them yourself etc.,

I recommend it because Windows 10 is treacherous when it comes to dynamic memory and runtime errors - because of its “fault-tolerant heap shim” that will occassionally cover up your possible grievous runtime errors, behaving like nothing happened, leading you to believe your code is good, while it could crash when you run it later or on different system.
Linux isn’t this “tolerant” - it will crash immediately in these cases, but then again, you can natively build C++ code in Linux as well as use Valgrind to check for runtime memory leaks.

What runs flawlessly in Linux, runs flawlessly in Windows as well. Once you have a clean code developed in Linux, you just transfer and build it in Windows using msys2 mingw32.

Many thanks.
Best,
Paul

I have been using Visual Studio 2017 with OF 0.10.1 and of 0.11.0 on Windows 7 (should be essentially the same on Windows 10) and MacOS and Linux. I started with OF 0.9.8 on Linux, and have been able to move my OF projects between the three dev environments easily - the main issues being learning the quirks of each dev environment.

I found Visual Studio 2017 to be relatively easy to use with OF, following the walkthroughs on the OF site. I have not tried VS 2019 or qtcreator.

with vs2019 you can just hit update project (there’s a dialog when you open a project) and it works similar to 2017.

1 Like