[FIXED] Error: "The preLaunchTask 'C/C++: g++.exe build active file' terminated with exit code 1"
ฝัง
- เผยแพร่เมื่อ 28 ก.ย. 2024
- This is a common error in Visual Studio Code, and you might have encountered this and didn't find a workaround.
Well, this short video is what you are looking for!
If this doesn't solve, then you can use WinLibs as an alternative to msys2 to install the appropriate compilers. And don't forget to setup the path in Environment variables on your system. Then your VS Code will automatically detect your compilers, whether it be GCC or Clang.
When you try to click on run/debug option
It always says prelaunch task C/C++ :g++ terminated with exit code -1.😡
Why any youtuber is not talking about this shit?
At last it is showing in terminal that:
The terminal process failed to launch (exit code: -1).
these bastards dont know to resolve a problem and are creating videos to make use fools
bro it's not working
recreate the project
In my case .exe file is getting generated but the output is not getting printed in the vs code terminal. Any idea what might be the issue?
Once you get the executable file using this command: g++ -o
Then just type the "outputfilename" in the same terminal you used before.
You can watch my other video on C++ installation and running.
I have been searching for 1.1 weeks for my problem to be just this. thank you sir
bro whoever you are, god bless you! I finally made my vscode run..
bro I have been trying to solve this problem for 2 hours and your video fixed it thank you
A simple solution the headache that it gave me looking for simple solution.
Thank you so much bhaiya .I have been searching for its solution from a week .Finally I can code now.
Thank you I’ve been trying to figure this bs out for a minute now 💆🏻♂️
Sir but how can i delete my vscode folder because there is many files existing in that .
If you have important settings file available there, then make a copy of the .vscode folder elsewhere. After that just delete this folder from VS Code. Now copy back your settings files into this .vscode folder again. In this case, you will not lose any of your custom settings made.
Sir this compiler can't download in my pc , what can i do 😭
download kar phir
Finally after weeks it's solved for me
I did same but it dosen't work
Maybe the path of your compiler is set to some folder that isn't there. Check that in the C++ extension settings inside VS Code.
Sir this aap can't run in my pc , 😔 what can i fo ?
Maybe the path of your compiler is set to some folder that isn't there. Check that in the C++ extension settings inside VS Code.
Sir yesterday i used build file extension in c/c++ extension, after that I face error in every code in visual studio
Thank you sir, it really helpful.
Thank you, you are a life saver. ..
This video is very helpful for me , thanks you
Thank you for video, keep going
does this work on mac;
I hope it will!
God bless you!
Thanku Bhai working ❤❤❤❤
thanks it worked
thanks a lot
thnx saar
Thank you
it does not work for me what can i do?
Maybe the path of your compiler is set to some folder that isn't there. Check that in the C++ extension settings inside VS Code.
And also check whether you have installed compilers properly.
thanks you so much
Thanks bro hope that msys2 is safe cause my defender is giving warning
Yes it is safe to use. No worries.
Hey guys so I found the problem
type the below in the msys64 terminal
pacman -Q
if you cant see gcc and g++ in it type the below code to download the files required
pacman -S mingw-w64-x86_64-gcc
And it worked smoothly for me.
thank you man i finally founded the solution from you after a lot of timmmme thanks brooooo
Bro i am still getting the same error. What you have done more?
@@satyamrawat4079In the video I said to delete the .vscode folder. It will actually reset the settings for you. After that just restart VS Code and your error will not be there. If the error stays, then that means the settings for running cpp files is set to some other paths. Kindly check that. But the simple solution is to just delete the .vscode settings folder. When you run your cpp files again, there will be no error.😢
This does not work. It just keeps recreating that vscode thing I deleted
thank you
Whatever I do I still I get a message in the terminal what the terminal process terminated with edit code -1
same bro
Thank you so much! I have been struggling with this for so long and couldn't find an answer. I appreciate you!
You are incredible man! Huge Thanks.
thanks, I might have chosen the wrong compiler or sth (gcc). So delete .vscode and choose g++ solved the problem.
Thanks alot bro ❤
it works
thank you vro
Tnquuu
folder not deleted ............. after deleted still showing
not helpful
could you fix the problem using any other way?
@@sumyaerfan6205Yes ma'am
Make .exe file of same program file and then execute the same
Lov U BRO ♥
Just letting you know, I did this for my C#. fixed it too. It now exits with code 0 (0x0). which I am given to understand it should. Thanks.
Just talked with my ChatGPT and yes it give me a great solution but this guy give me easier way to fix it
Thanks man! This was an easy fix but I struggle for hours. 😂
Thanku it worked...
I found this video after apply several method... And none of them work.. But it did 🥰✨...
i love you and thank you
thank you very much
Thankyou brother
Thank you so much, I apperently have a compiler on my system that gave me problems and changing compiler solved the issue! Many thanks you're a life saver
It encourages me a lot!
1 solution that worked for me was deleting the .vscode folder from my project folder and then running the code afterwards. Hope this helps!
Thanks. It worked!
can you share your theme name?
Install the Rainglow theme and select the Azure (Rainglow) from drop-down...😊