Get up and running quickly with Raylib on Windows using Visual Studio. Follow the installation and add my template to your Visual Studio installation. You then are able to quickly create a new project where Raylib is already statically linked.
- Visual Studio Community 2022 with the workload Desktop development with C++
- Git
Open a new developer command prompt and enter the following commands to clone Raylib:
cd C:\
mkdir SDKs
git clone https://github.com/raysan5/raylib.git
cd raylib
Keep this command prompt open for the building stage.
Next build the static configurations of Raylib as follows:
cd projects\VS2019
devenv raylib.sln /build "Release" /project raylib
devenv raylib.sln /build "Debug" /project raylib
devenv raylib.sln /build "Release|x86" /project raylib
devenv raylib.sln /build "Debug|x86" /project raylib
The template will use the environment variable RAYLIB
as a pointer to the root folder of Raylib. Create a new user or system variable to point to the root folder of Raylib:
- Variable name:
RAYLIB
- Variable value:
C:\SDKs\raylib
From the releases page of this repository download Raylib Static.zip
and put it in %UserProfile%\Documents\Visual Studio 2022\Templates\ProjectTemplates
. Next time you open Visual Studio the new template shoud be added.
How to remove the console window from my Raylib project?
Go to project settings and set the following properties for all configurations and all platforms:
- In Linker > System set SubSystem to
Windows
- In Linker > Commandline add
/ENTRY:"mainCRTStartup"