#How to get vscode to work
59 messages · Page 1 of 1 (latest)
You don't need Visual Studio, just the Build Tools
You should be able to get the 2019 build tools with a bit of searching on Microsoft's website, I don't know why it redirected you
thanks, i will serach around
i checked and was not able to find it, the closest thing i saw i needed to login to a microsoft account
Please ask on #rust-discussions-1 then, there is only me here and I'm not around a computer to help you
Hi! I’m here
Sorry by the way I dont understand much
Is ok
So, forget about whatever state VSCode is now, do you now know where your folder with your main.rs file is on your computer? Can you access it using the file explorer?
ok, so what you need to do is ensure you open VSCode with a right-click on the folder, and using this option (in english for you). This will open VSCode in a desirable state, then I can proceed to help you from there
If you did things correctly, when VSCode opens, the top left part of the program should look something like this:
if it looks like this, don’t worry I’ll help you fix it:
okay i got it like the first one
That is great!
Now, if you do Ctrl + `, you should be able to open a terminal, can you tell me what the prompt is like?
(the part that shows on the last line)
i got the terminal open so what do you want to know
Just what the last line shown says
Something like PS C:/<a long path>?
To ensure your commands will work
By the way, you can select text in your terminal by dragging the left-click, and copy it with a right click
You can also paste text in it with a right click
It should be in your clipboard
like the highlight
PS C:\Users\Sawyer\Hello World>
error: linker link.exe not found
|
= note: program not found
note: the msvc targets depend on the msvc linker but link.exe was not found
note: please ensure that VS 2013, VS 2015, VS 2017, VS 2019 or VS 2022 was installed with the Visual C++ option
error: aborting due to previous error
yup, you missed a step when installing Rust, let me get the thing
ok
You need that
ok
It’s a link, just follow it, download it and install it
Put simply, rustc needs it in order to work properly on Windows, but it cannot install it itself because it’s a Microsoft thing and they don’t have the rights for it, so you need to download it separately, from Microsoft’s website
I have to make some mayonnaise, I’ll be right back soon
Mayonnaise’s done, how are you doing?
i clicked the download build tools it appeared in my downloads and i clicked open file blah blah blah its asking me if i want to launch it
Yup, that’s normal!
Congrats, you’ve got yourself a working Rust setup
If you then type ./main, your first program will run!
(it just tells the terminal to run ./main.exe, the .exe part is optional)
Now, remember these things and you should be okay:
- Open VSCode on a whole folder, either from the file explorer, or using the
File > Open Folderoption - When using VSCode’s terminal, it opens by default in your opened folder
- Use VSCode to create files, write in them and save them, use the terminal to run your program
Once you get some experience you’ll discover that there are a lot of tools you can use to help you, and nearly all of them will be available from either VSCode or the terminal
Since we got VSCode to work, I’m going to leave this post, if you have questions regarding Rust, feel free to ask them in #rust-discussions-1 again 😎