This is a sample starter project for the Technical University of Cluj-Napoca - Faculty of Automation & Computer Science - Computer Science Department
!!! IMPORTANT !!! This setup is meant to be used WITHOUT Visual Studio. If you want to use Visual Studio, then just simply download the starter project specific to your Visual Studio version from the labs homepage. Visual Studio can be a HUGE resource hog, so in case you don't want to use it and would rather use the much more lightweight and less resource intensive Visual Studio Code, then this is the setup for you.
-
Since we are going to use VS Code as our IDE, we need to install a compiler and a build system. For this we are going to use MSYS2, which is a minimal unix-like environment for Windows that uses pacman as its package manager for easy installation of packages and other dependencies that you will need.
From the MSYS2 homepage, download the installer and run it. -
Once you have installed it, run the UCRT64 based shell. To paste text into the shell, right click on the title bar and select
Edit
->Paste
or pressShift
+Insert
.Inside the shell, run the following commands to update the package database and upgrade the packages to the latest version. When asked, please confirm the installation of the packages by typing
y
and pressingEnter
.pacman -Syu
The terminal might want to close in case of some critical updates, such as
pacman
, please confirm that as well and then open the shell again. -
Next, you will want to install the following packages:
pacman -S base-devel mingw-w64-ucrt-x86_64-clang mingw-w64-ucrt-x86_64-lldb mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-opencv mingw-w64-ucrt-x86_64-qt6-5compat
-
Now that you have installed all the packages, you will need to add the MSYS2 binaries to your
PATH
environment variable. Go ahead and open theEdit environment variables for your account
window by searching for it in the start menu. -
Click on the
Path
variable and then click onEdit
-
Add the following new entries to the list:
C:\<PATH_TO_WHERE_YOU_INSTALLED_MSYS2>\ucrt64\bin C:\<PATH_TO_WHERE_YOU_INSTALLED_MSYS2>\ucrt64\lib
NOTE: In my case, I installed MSYS2 in
C:\Users\Public\Apps\MSYS2
, yours might be different, so please make sure to use the correct path.Afterwards, click on
OK
in all of the dialogs / windows to save the changes. -
Now, go ahead and fire up VS Code, where you will need to install the C/C++ extension for VS Code. To do this, open VS Code and click on the
Extensions
icon in the left sidebar. Then search forC/C++
and click onInstall
. -
Once the extension is installed, then go ahead and open the project from GitHub in VS Code. When the project is opened, you should configure CMake by opening the command palette with
Ctrl + Shift + P
and then searching forCMake: Select a kit
. Select theClang 17.0.6 x86_64-w64-windows-gnu (ucrt64)
kit. -
This should automatically configure CMake. In case it didn't, then open the command palette and run
CMake: Configure
. You should see a similar output in your editor as well: -
Then you should build the project by either clicking on the
Build
button in the bottom left corner of the editor or by opening the command palette and runningCMake: Build
(Ctrl + Shift + B
). -
Run or Debug the project by clicking on the
Run
orDebug
buttons in the bottom left corner of the editor.