How to put in C++ External Library in VS Code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody this is King Tut here and welcome to another video in this video I'm going to be showing you how to put in external library and visual studio code in C plus plus so before we begin um there's few things you need before watching this tutorial so you need the Ming w64 or at least Ming W in general the compiler uh GDP so G D and B for the part of Ming W but for debugging as well or else it's not going to work and um you need to have Visual Studio code so assuming you all have that um you're good to go and you could watch this video uh so let's begin with opening folder and let's go to whatever you want to make your folder in so I'm going to go to the desktop I'm going to go to programming go to C plus plus and then I'm going to make a new folder called x uh how about um external Library let's just do that and then go there and then you select folder and yes trust the authors and stuff and then you make a new new file and then let's put test.cpp always you need to have the CPP extension or else it's not going to work so let's put in all the stuff make sure it works and then we can move on to the next step so let's put in let's print out a hello world so let's include iostream um using name space CD and and Main and let's do see out hello world 5x2 exclamation point and let's end line and then let's save it no no save it here I accidentally press Ctrl a and so in the newer parts of Visual Studio code it seems like they have this so let's let's click on that that's going to be debugging and then pick the um I usually pick the top one or actually no let's not pick the top one let's pick this one here so I'll tell you why oh there's no C make okay my bad it's there you go I just ran again and it print out hello world so everything is working so I don't know what's what's the other part about I have no idea Okay so so the one that's just says um Ming w64 don't worry about the URT uh that's something else I have done I was following a tutorial online on its website but um it's it's the same kind of thing you usually been doing so if you watch my first Visual Studio code video um those random tutorial you'll understand what I mean all right so so once this is works let's get into the nitty-gritty so first things first you need to get into uh make sure you have C plus plus installed which I believe which that's a necessity to run C plus plus code and and I think you go to extension settings and you go to you scroll down until you get to the include part all right let's scroll down scroll down scroll down and then you have this include path make sure this set this points to the include directory and mysis 64 Ming w64 include once you make sure then we can go to the next step if it wasn't there you could actually add an item and you could um go to your folder here and go to your C drive you could go to myself 64. Ming w64 include and then you click right here and an empty spot on this bar and then it's gonna highlight the whole directory you right click click copy and then you paste it over here but I already have it so I'm going to click cancel so the next step here is to download an external Library through my sys2 so I've put it I've done Allegra tutorial but for this video I'm going to do ray lib I it's more of a recent library and I really like their tutorial on their website and especially their sample code so let's uh get right to it so all you need to have is Pacman dash s and then you have Ming w uh all of this I'm gonna put this whole thing in the description then you press enter and then wait for it to install and then it's it's saying reinstalling I already have it installed and then the Big Y means yes by default if you don't put any input so I'm just going to put enter to make it yes by default and it reinstalled everything all right so once that's done let's go back here and also let's get let's go to tasks so make sure you go to the Explorer icon you click on that explore icon the one on the top here and then you expand vs code and then you go to tasks dot Json we're going to be adding a few things here uh just pretty much one thing so let's get some linkers here I'm also going to put the linkers in the description as well so let's I'm gonna Google some stuff so Ray lib linkers uh let's I don't know why Google is not getting me let's do ray lip tutorial and let's go to let's see I'm pretty sure they have something for me to I'm using another screen so I'm using two screens but I'm using the second screen so that's why um trying to there you go all right so you I think you only put uh L Ray lib so let's copy here so you do it right here and you put around these quotations and make sure you put a comma here and that's pretty much it you save it first and then you go right here and then let me copy and paste the source code the example source code let me there you go and I'll link this examples right here so I got the source code from right here and I'll put this link in the description as well so let's so it's a bunch of stuff here and who knows I might be doing a ray lip tutorial sooner or later so stay tuned alright so let's get Let's uh bring back the terminal so I pretty much for the sake of space there you go um for the sake of space Ivy basically uh hit the terminal and I click on debug and it says uh it gave me errors so why is there an error so there's no no such file or directory that's interesting oh that's why I think I know why there you go so let's change it Ray lip should it should work why why am I not that's interesting that never oh yeah that's why all right so right here this is wrong actually this whole thing this whole task here is wrong it's not ucrt64 it's supposed to be Ming W 64. so right here Ming w64 so I'm just going to copy this part here so just go make your cursor right here press shift and then highlight that part control C and then you control V right there and everything should be fine and it's actually building it and actually it's doing its thing and right here you got the sample code in the sample window congrats you have created your first window if you got that then congrats you did it so that's how you put in external Library if you're doing in sfml they have their own Linker but make sure in the C plus configuration it's point to that certain a place that certain include place where the all the include files for that external library is if you're using mysis 2 it's very easy you could just only point to that certain compiler you're using to that include folder so I hope this tutorial helps you and if you really like this video please like And subscribe and also share this video with other people who are struggling with this and comment let me know what you think and um I'll see you in the next video bye
Info
Channel: King Tut
Views: 51,515
Rating: undefined out of 5
Keywords: King Tut, King, Tut, vlare, youtube, odysee, bittube, bitchute, rumble, education, random tutorial, vscode, raylib, tut, king, external library, external, library, visual studio code, visual, studio, code, cpp, c++, linker
Id: j164FhFMrsI
Channel Id: undefined
Length: 12min 23sec (743 seconds)
Published: Mon Apr 24 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.