Setup CMake in Visual Studio for CS184 (Spring 2019 UC Berkeley)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys I'm Ming Lee and I'm recording this video to show people how to get c++ working in Visual Studio on Windows because a lot of the solutions on Piazza are a lot like very over complicated because Visual Studio has support for C make now so the first thing you need to do of course is install Visual Studio which I already have installed if you want to make sure that you have the Visual Studio Tools for C make installed so to do that open the Visual Studio installer from the Start menu and then click on modify Visual Studio and go to the second tab individual components and about halfway down there is here visual C++ tools for C make and make sure that box is checked if it's not checked check it and down here click modify and it'll install everything you need all right so then get started I will clone the homework 0 repository and make sure to go into the repository and check out the windows branch because that has a fix for the TrueType issue and then we'll go to visual studio and from here we do file open folder and we'll just open the git folder we just cloned now this will take a few seconds to load up everything so at this point you want to make sure you have this bar up here with the drop down and this play button if you don't have that just right-click on the top and make sure standard is checked like this so then that'll make this show up and I hid some of the other buttons so that's why mine might look a little different and then what we're going to do is click on this drop down and click on manage configurations there's a pop up this and we'll select x86 - debug this will pop open I see makes setting Jason which is specific for visual studio and then I'm gonna change the build route and install route properties because by default it just puts all your all your build stuff all the executables created in a random folder somewhere so we'll change it by taking off these first two folders and replacing workspace hash with workspace route so this will just put everything in this folder that I'm currently working with so at this point we can go up to the top click on the drop down here and select triangle test exe go ahead and click it to run it so it should build at this point already and run but it will fail to load the TrueType library at this point so we can see it excuse-me freetype so failed to find freetype 6 dll ok so close that to fix that we can just copy and paste freetype 6 dll into the build folder so to see the build folder we have to find this show all files button in the solution explorer and that'll show build here we can see there's x86 debug which we set up and we have all our stuff together basically a bunch of build artifacts so at this point we just need to grab free type six DLL from somewhere and I happen to find a copy of it in my installation so I'll just grab it from one of my previous installations now so let me see so three times six DLL and I'll figure out some way to like download this so you can get it basically just take that and drag it into the build slash x86 dash debug folder so then at this point we can run it again and after it builds it runs and here's our triangle drawing and we can see the font does not look very good so maybe that freetype six dll is out of date or something but I don't care since it compiles and builds and runs and that's what matters okay so that's basically what you need to know but for later things you have to I'll show how to supply command line arguments to this so to add command line arguments and also show how to debug the program so to add command line arguments we right click on see make lists txt and there is let's see somewhere here there's debug and launch settings so just hover over that and select triangle test exe and this will open this launch VSD Jason this is actually just stored in this dot vs folder so you can also find it there and add an argument just add a args property to the configuration and just put as many arguments as you want here and if you want it's kind of weird if you actually want an argument to have spaces in it you have to escape your quotes yourself and enter it like that so we can show that this actually works by going to triangle test dot cpp going to main and just set a breakpoint here and run it and it hit the breakpoint here and we could just see in the args RB of 0 is just the path to the executable or the if one is hello are the to its world and our vo3 is the whole string with the exclamation mark in the space all right and that's how you do it you can step through your program like any other debugger do whatever you want all right so that should hopefully be useful to people thank you for watching
Info
Channel: Mingwei Samuel
Views: 8,774
Rating: 4.2835822 out of 5
Keywords:
Id: SYcTXK4q2Hg
Channel Id: undefined
Length: 8min 37sec (517 seconds)
Published: Tue Jan 29 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.