mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Page:
Create Visual Studio 2019 Project
Pages
CMake Build Options
Community Resources
Compile for OSX
Create Visual Studio 2019 Project
Create Visual Studio Project
Creating Discord Activities with raylib
Frequently Asked Questions
Home
Install and configure Touchscreen Drivers (RPi)
Quick Setup for Windows with Visual Studio 2022, GCC, or MinGW
Redirect raylib output to Framebuffer 1
Screen Recording
Use multiple windows
Use raylib with Code Blocks
Use raylib with Eclipse
Use raylib with Sublime Text
Using BMFonts
Using SPI Displays with raylib
Using raylib in VSCode
Using raylib with Cpp
Visual Studio C# Setup
Working for Android (on Linux)
Working for Android (on macOS)
Working for Android
Working for Web (HTML5)
Working on Chrome OS
Working on FreeBSD
Working on GNU Linux
Working on Raspberry Pi
Working on Windows
Working on exaequOS
Working on macOS
Working with CMake
raylib GLFW dependency
raylib architecture
raylib coding conventions
raylib data structures
raylib default shader
raylib dependencies
raylib enumerated types
raylib generic uber shader and custom shaders
raylib input system
raylib integration with other libraries
raylib libc dependency
raylib platforms and graphics
raylib syntax analysis
raylib templates
Clone
18
Create Visual Studio 2019 Project
Jeffery Myers edited this page 2022-04-16 10:03:22 -07:00
Raylib Visual Studio 2019 configuration
Premake Easy Setup
@JeffM2510 has made a guide to easy setup for visual studio using Premake. You can read the wiki page about it here. https://github.com/raysan5/raylib/wiki/Easy-Raylib-Setup-for-Windows-with-Visual-Studio
This is by far the simplest and fastest way to setup raylib for Visual Studio.
Building raylib.lib and raylib.dll
- Download or clone raysan5/raylib folder.
- In "(your_folder_location)/raylib/projects/VS2019" find raylib.sln and open it with Visual Studio 2019.
- Go to Solution Explorer window and find raylib project
- Right click on it and choose Set as Startup Project
- Check Solution Configurations (must be Release.Dll x64)
- Go to Build > Build raylib or press Ctrl + Shift + B to build raylib.lib and raylib.dll
Creating your own project
- Create new project > Console App
- Go to Project > Properties
- In opened window go to Configuration Properties > C/C++ > General and add
(your_folder_location)\raylib\src folder(contains .h files) to Additional Include Directories - Go to C/C++ > Preprocessor and include the following Preprocessor Definitions (for Windows platform):
GRAPHICS_API_OPENGL_33PLATFORM_DESKTOP
- Go to C/C++ > Advanced and set Compile As to Compile as C Code (/TC) (if you want to use code from examples) ** Note that this step is not required. By default *.c files will compile with C and *.cpp files will compile to C++. If you intend to use C++ or do not want to forcibly restrict yourself to C, do not change this setting.
- Go to Linker > General and add
(your_folder_location)\raylib\projects\VS2019\bin\x64\Release.DLLfolder to Additional Library Directories - Go to Linker > Input and add
raylib.libandwinmm.libto Additional Dependencies - Go to "(your_folder_location)\raylib\projects\VS2019\bin\x64\Release.DLL" folder and copy raylib.dll and raylib.lib to your project folder. For example, if your project name is "Demo" then copy these files into the folder
(your_folder_location)\Demo\Demo. - Set your project's platform to x64 (if you build your libraries in x64)
Start coding
- Go to https://www.raylib.com/examples.html and grab some code to your .cpp file
Frequently Asked Questions
Library Design
- Architecture
- Syntax analysis
- Data structures
- Enumerated types
- External dependencies
- GLFW dependency
- libc dependency
- Platforms and graphics
- Input system
- Default shader
- Custom shaders
- Coding conventions
- Integration with other libs
Development Platforms
- Working on Windows
- Working on macOS
- Working on GNU Linux
- Working on Chrome OS
- Working on FreeBSD
- Working on Raspberry Pi
- Working for Android
- Working for Web (HTML5)
- Working on exaequOS Web Computer
- Creating Discord Activities
- Working anywhere with CMake
- CMake Build Options
IDE Configurations
- raylib templates: Get started easily
- How To: Quick C/C++ Setup in Visual Studio 2022, GCC or MinGW
- How To: C# Visual Studio Setup
- How To: VSCode
- How To: Eclipse
- How To: Sublime Text
- How To: Code::Blocks
Misc Help
www.raylib.com | itch.io | GitHub | Discord | YouTube