Skip to content

Create Visual Studio 2019 Project

Grave edited this page Jan 11, 2021 · 18 revisions

RayLib 3.5 and Visual Studio 2019 configuration

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 + 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_33
    • PLATFORM_DESKTOP
  • Go to C/C++ > Advanced and set Compile As to Compile as C Code (/TC) (if you want to yse code from examples)
  • Go to Linker > General and add (your_folder_location)\raylib\projects\VS2019\bin\x64\Release.DLL folder to Additional Library Directories
  • Go to Linker > Input and add raylib.lib to Additional Dependencies
  • Go to "(your_folder_location)\raylib\projects\VS2019\bin\x64\Release.DLL" folder and copy raylib.dll to your project folder (main *.cpp must be in this folder)
  • Set your project's platform to x64 (if you build your libraries in x64)

Start coding

Clone this wiki locally