Unable to see Raylib compiler in list

Hi,

I’m starting on the C++ Fundamentals course and I’m struggling through it a bit, got the workspace set up and up to the point where I need to select the Raylib compiler from the Terminal dropdown.

In the video it shows having the Raylib compiler listed, but I’m not seeing it there. I’m wondering if it’s because it hasn’t picked up my Raylib installation, but I can’t see anything in Visual Studio Code to actually set search paths for applications.

Feel like I’m missing something daft to get it to link and appear in Visual?

EDIT: Saw someone comment on one of the videos to go into the .vscode files and ensure the filepaths were to the right place. Can confirm all the filepaths are correct and point to the default install location I used (C:/raylib/). Despite this when I used Configure Default Build Task I do not get the options shown in the video.

I had to follow this solution : Your First Program
and reinstall Visual Studio Code after installing Raylib and after the compiler was in the terminal dropdown.

But the shell restart needed when installing Raylib maybe the cause I don’t know! Maybe just a PC reboot could be ok!

This explains how to use raylib with VSCode. Essentially copy the raylib files that were downloaded to any folder you will use to store code. Then open workspace in that folder using VSCode file - Open workspace. Add files like hello.cpp save to the same folderl.
Using raylib in VSCode · raysan5/raylib Wiki · GitHub

@Bishmanrock When you cloned the VS Code Template to VS Code, did you see two lines in the output window that mentioned windows-gcc ? Here’s some nomenclature confusion.

  1. The raylib MingW install for Windows, the recommended one, is a combination install of MingW, notepad++, and a variety of raylib materials.
  2. raylib is essentially a library and the library is relied upon in the transformation of C/C++ programs that we will write to into nice (graphical) game programs that run on Windows.
  3. MingW is a sort-of platform that provides a development environment for developing on Windows that is adapted from similar tools for Unix/Linux systems.
  4. gcc (also known as g++) is a C/C++ compiler developed for Unix/Linux system and is installed as part of MingW. That is the compiler that will be used in this course.

When you get to the place where you use the VS Code Terminal | Configure Default Build Task … in Lecture 2, it should have offered you options to choose from. The one you want is compiler: C\raylib\mingw\bin\g++.exe

I have found no way to change that once it is set. It actually can be done – the setting is in a JSON file. But the easy way is to delete the vscode-template folder and clone the VS Code Template from GitLab all over again. It doesn’t take long.

I’m sorry about the confusion all. I didn’t explain the process very well.

I’ve re-recorded the Setup and Installation videos, as well as the setup videos for Axe Game, Dapper Dasher and the Classy Clash game as well. I’ve show all the steps that will get your code compiling.

Also, the VS Code template is now different, so you’ll need to download it again (I download it as a .zip in the video now).

And there’s a Raylib VS Code template for raylib projects and a VS Code template for plain C++ projects as of now.

The process is to download the .zip file, extract it, and simply open the workspace. You can do it by right-clicking on the main.code-workspace file and clicking Open with Code (if you enabled that feature when installing, which I’ve added to the installation video) or, if you don’t have that feature, simply open VS Code and go to File → Open Workspace and find the project’s main.code-workspace and open that.

You don’t need to Configure Default Build Task or anything. The .vscode and Makefile take care of everything. You can create a source file and start coding, or use the projects on the Gitlab page. Everything should compile just fine (compiling will create an .exe of the game) as well as Start Debugging and Run Without Debugging.

The videos are up on Udemy and should be up on the other platforms shortly.

Again, I’m very sorry for the frustration and things should work smoothly now.
Stephen

@StephenUlibarri Don’t worry too much, use it as feedback to improve further courses.

In you videos you mentioned beside Windows also VS Studio shortcuts for Mac and linux,
is there a chance to get an installation instruction also for Mac and Linux from you?

We have uploaded a Mac installation video and are working on the project files so the same install instructions for Mac will work for linux.

Hi @StephenUlibarri,

Any chance of having a setup section for using Visual Studio 2019 (community edition) instead of VSCode?

Probably not. We are sticking with tools that will work for all the platforms.

1 Like

Thanks for the update Stephen, that’s a shame. I have that installed from other courses and didn’t want to have to install VSCode. Downside is that there are lots of niggles/quirks trying to follow along. Was going to brush up on my C++ and thought I’d start with your course :slight_smile: Not to worry.

Yes, I’m sorry. I personally am a much bigger fan of Visual Studio myself.

There are instructions for setting up VS Code to work with VS Studio (all editions). The ones on raylib involve using VS Projects and Solution. That’s far out of line from this course.

However, if you have VS Build Tools (included in the Community edition), you can do command-line compiles. Integration with Visual Code is trickier though.

I am about to go through the setup process for doing FC_CPP with VS Build Tools. I want to be able to do courses like this using the Microsoft command-line tools since I want to make code that I could put in a Microsoft store or delivery as web downloads, etc. Raylib will obviously work in this case, although might have to build a raylib.lib for static binding so that the compiled game.exe is self-contained.

When I have some useful materials, I’ll provide a link.

PS: You could forego the use of VS Code and simply use VS Community Edition directly. It has an already-integrated IDE and using the VS C/C++ compiler, cl.exe, is built in and ready to go.

The only tricky part is having a raylib.lib and also putting all the raylib header files in a place that you can then tell VS Community to look into. That’s sort of the thing also required with VS Code and the VS Build Tools, except setting up configurations is different.

Game resource and asset incorporation, being able to save game state, all those things are pretty much the same either way.

You can easily set that up via vcpkg. You just need git and the Visual Studio C++ workload installed.

Follow the instructions here: https://github.com/microsoft/vcpkg#quick-start-windows

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms