Of course, this is not a silver bullet and will not guarantee an identical experience to development on linux. Set the platform toolset to LLVM - Clang in the project general config.Go to project properties by right clicking on the project name and clicking properties.Create an empty C++ project (don't worry it's just named C++ but will work just fine with C - with the C compiler - not C++ compiler).You usually won't have to worry too much about playing with extra cmdline options other than the ones cs50 has taught you. Under "Desktop development with C++" also select "C++ clang tools for windows"Ĭlick install and clang will be usable to you through the commandline, just like the CS50 terminal. The simplest way to get up and running using clang is to download Visual Studio (not code) and choose the following toolsets during its installation. Then you have an option to install their unofficial build of Clang instead of the regular one, which has an advantage of using -target=x86_64-w64-windows-gnu automatically (so you don't have to write it manually), but also takes up considerably more drive space, and used to be a bit unstable for me in the past.Įxpanding on HolyBlackCat's answer. If you don't have MinGW yet, you can get a fresh version from MSYS2. (That's assuming your MinGW produces 64-bit apps. If you want to use it with MinGW and have it installed, use clang -target=x86_64-w64-windows-gnu instead of gcc, and it should also just work. If you want to use it with MSVC and have it installed, running clang-cl instead of cl should just work.īut since you mentioned VSC, I assume you don't want MSVC. Clang is going to use the standard library (and other libraries/headers) of that compiler, since it doesn't ship with ones of its own. On Windows, Clang is not self-sufficient, and is supposed to be used in combination with an other compiler: either MinGW (GCC) or MSVC.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |