Cargo build broke after using VS code - visual-studio-code

For a while I have been editing my Rust program with Pycharm Professional. However, I was curious and experimented with VS Code. At first my project was compiling and running. However, it suddenly started throwing a pretty wild error on cargo build and cargo run (while cargo check is fine), even in cmd outside of VS Code:
error: linking with `link.exe` failed: exit code: 1104
= note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\rust\\book\\target\\debug\\deps\\book.1apvyby1qhuehv3.rcgu.o" "C:\\rust\\book\\target\\debug\\deps\\book.1cw7xmk0cjjg5uln.rcgu.o" "C:\\rust\\book\\target\\debug\\deps\\book.1e8ho0j4rykowhcr.rcgu.o" "C:\\rust\\book\\target\\debug\\deps\\book.1g2fbveo2gp7bxds.rcgu.o"
..............
..............
= note: LINK : fatal error LNK1104: cannot open file 'C:\rust\book\target\debug\deps\book.exe'
book is the name of my project.
I am on Windows 10, System Type: x64-based PC.
VS Code version 1.63.2

Sometimes VSCode file watcher watches the files in target/, that is not good.
So open the Settings, search for exclude, and in all "list-like" cofigurations add **/target/**, do a cargo clean and restart VSCode. This should fix this and future problems

Had to remove the directory, and redownload the whole project(used Git).

Related

How to remove the following error in VScode: zsh:1: command not found: msbuild

I have recently started writing my LaTeX documents in VScode on my Mac running Big Sur.
I am able to build my .tex files without issue using the built in "Build LaTeX project" option (the green arrow -- short cut OPT+CMD+B). When I try to build the .tex file with CMD+SHIFT+B, however, the terminal pops up with the following text:
Executing task: msbuild /property:GenerateFullPaths=true /t:build /consoleloggerparameters:NoSummary
zsh:1: command not found: msbuild
The terminal process "/bin/zsh '-c', 'msbuild /property:GenerateFullPaths=true /t:build /consoleloggerparameters:NoSummary'" failed to launch (exit code: 127).
Terminal will be reused by tasks, press any key to close it.
Despite this, the .tex file is still built as normal. My question is: why is this happening and how do I fix it?
Thanks!

The terminal process failed to launch: A native exception occurred during launch (File not found: )

I keep using vscode debug for long time. But it began to fails to use debug from yesterday.
It reports that The terminal process failed to launch: A native exception occurred during launch (File not found: ).
I can use powershell in terminal.
I have tried solution in (https://code.visualstudio.com/docs/supporting/troubleshoot-terminal-launch), but none of them works.
Code -version: 1.47.3
Operating System version: windows 10 1909 build 18363.959
all extensions:
albert.TabOut
christian-kohler.path-intellisense
CoenraadS.bracket-pair-colorizer-2
Equinusocio.vsc-community-material-theme
Equinusocio.vsc-material-theme
equinusocio.vsc-material-theme-icons
eryouhao.brackets-light-pro
formulahendry.code-runner
formulahendry.terminal
Gruntfuggly.todo-tree
HookyQR.beautify
James-Yu.latex-workshop
kisstkondoros.vscode-gutter-preview
manasxx.background-cover
marlosirapuan.nord-deep
MS-CEINTL.vscode-language-pack-zh-hans
ms-python.python
ms-python.vscode-pylance
ms-vscode.cpptools
naumovs.color-highlight
niudai.vscode-zhihu
nnthink.aixcoder
redhat.java
skacekachna.win-opacity
sldobri.nord-5-stars
TabNine.tabnine-vscode
VisualStudioExptTeam.vscodeintellicode
vscjava.vscode-java-debug
vscjava.vscode-java-dependency
vscjava.vscode-java-pack
vscjava.vscode-java-test
vscjava.vscode-maven
vscode-icons-team.vscode-icons
wix.vscode-import-cost
yzhang.markdown-all-in-one
zhuangtongfa.material-theme
setting.json:
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
In my case this problem arising after updating VS Code version to 1.54.3 on Ubuntu 18.04.
This problem is resolved by restarting VS Code after the update.
Yep, that's kinda what my problem was...PS had been blocked at a system-admin level.
Make sure that you can actually run PS from the command-line or start window.
Win10 popup
I fixed it by change "terminal.integrated.inheritEnv" to false in setting.json.
I also had the same issue and asked the question one week before yet didn't get solution.
here is link of my question
[link]Visual Studio (VS-code) code terminal is failed to launch
1 solution i got:
the issue arises when you delete some of it's files before by mistake and you don't know try to remember that or simply recover your pc to 3 weeks ago atleat so all files will be placed suitably.
I had the error. To fix it, I looked at all the terminal settings in VSCode and checked out the ones that weren't set to the default value. Eventually, I found that the path to my PowerShell had changed to the preview version I had installed. Reverting this to its default got it working again. Hope this helps someone.

Getting ModuleNotFoundError in python, package exists in virtual environment though

I am new to python and writing my first python file using Visual Studio Code. Till yesterday the code was working fine. But today it is starting to give ModuleNotFoundError. I double-checked the package and the package is there under lib folder of the virtual environment. Moreover, IntelliSense is also working fine, whenever I write import it shows the requests module in the available list. I am facing problems with IntelliSense also, as sometimes it stops working for no reason.
The major change that I did before executing the code is the integration of GitLab with my project.
Python Version: 3.6.2
Operating System: Windows
Git Version: 2.23.0
Pylint Version: 2.3.1
pip Version: 19.2.2
Requests Version: 2.22.0
Pytest Version: 5.1.1
Enabled Extensions:
Npm
Npm Intellisense
Ayu
Code Runner
AYU
Markdownlint
Predawn Themekit
Python by Microsoft
Can anyone have gone through with the same problem? Please help me to resolve this issue.
Attachments
Issue resolved I was running it using Ctrl+Alt+N (code-runner shortcut to run a project)which was creating this issue. But running the file in terminal using Run Python File in Terminal (option in the context menu when we do right-click in source .py file) giving me the expected result without any error.
Then I googled for how to alter this behavior so that I can get the same results by using Ctrl+Alt+N as well.
I found that; I need to add the following script under user's settings.json.
"code-runner.executorMap": {
"python": "h:\\practice\\virtualenv\\Scripts\\activate.bat && python -u"
}
Here is my complete user's settings.json
{
"workbench.colorTheme": "Predawn",
"workbench.iconTheme": "ayu",
"window.zoomLevel": 0,
"code-runner.executorMap": {
"python": "h:\\practice\\virtualenv\\Scripts\\activate.bat && python -u"
}
}

Eclipse (2018-09) CDT project with Cygwin, can't debug the binary

It seems that everything cygwin-related configured and works fine in my Eclipse project, for example Eclipse is able to invoke 'make' or 'gcc', and can even run the compiled binary and show the output in the Eclipse console window.
However, when I try to debug my binary within Eclipse, I get the following error:
Error in final launch sequence:
Failed to execute MI command:
-exec-run
Error message from debugger back end:
During startup program exited with code 0xc0000135.
Failed to execute MI command:
-exec-run
Error message from debugger back end:
During startup program exited with code 0xc0000135.
During startup program exited with code 0xc0000135.
I do able to launch gdb from my Cygwin console, so it is installed correctly (I assume). But why it fails when I try to use it from Eclipse?
For my case, as you say, it turns out that adding the Cygwin bin folder to the PATH variable solves this problem.
I use Eclipse 2020-06 and Cygwin 64bit on Win7 64bit. And installing Cygwin doesn't change the PATH variable currently.
But it is also confused to me that "build" and "run" work fine in Eclipse whithout the Cygwin bin in PATH.

Visual Studio Code macOS: error loading OmniSharp: spawn EACCES

I'm having no luck in trying to make the C# extension work in macOS. When loading the sln file everything seems to load just fine other than OmniSharp. This makes it hard or impossible to work with Visual Studio Code.
Here's the error I get:
Starting OmniSharp server at 2018-5-4 13:51:51
Target: /PATH/TO/PROJECT/Project.sln
[ERROR] Error: spawn EACCES
Which tells very little about what's wrong.
I followed all instructions found here, including installing Mono SDK but OmniSharp keeps giving this error. I also tried
to install the extension from a vsix file
to overwrite the omnisharp folder content with what I found here
All leading to the same error.
When the extension is freshly installed, it automatically downloads the OmniSharp package and successfully installs it.
Installing C# dependencies...
Platform: darwin, x86_64
Downloading package 'OmniSharp for OSX' (24026 KB) .................... Done!
Downloading package '.NET Core Debugger (macOS / x64)' (44057 KB) .................... Done!
Installing package 'OmniSharp for OSX'
Installing package '.NET Core Debugger (macOS / x64)'
Finished
Someone suggests to add a+x permissions recursively to the whole project folder (as found in this official thread) but is this really necessary? All files in extensions belong to the same staff group as all files in the project do.
I tried this anyway but still [ERROR] Error: spawn EACCES
I'm using Visual Studio Code 1.23.0 and the OmniSharp's version is 1.14.0.
I should also say that all projects I am trying to open are generated by Unity 3D and I have the Unity Debug extension installed.
I don't know where else to go from here. Would someone be able to give advice on this?