[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!

ความคิดเห็น • 74

  • @learnwithajit29
    @learnwithajit29  8 หลายเดือนก่อน +2

    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.

  • @Tocheck101
    @Tocheck101 22 วันที่ผ่านมา +5

    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).

    • @killerdonut666
      @killerdonut666 6 วันที่ผ่านมา

      these bastards dont know to resolve a problem and are creating videos to make use fools

  • @Raj605-l8f
    @Raj605-l8f 8 หลายเดือนก่อน +24

    bro it's not working

    • @airguy5964
      @airguy5964 6 หลายเดือนก่อน +2

      recreate the project

  • @abins641
    @abins641 หลายเดือนก่อน +2

    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?

    • @learnwithajit29
      @learnwithajit29  หลายเดือนก่อน

      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.

  • @saadmosar7423
    @saadmosar7423 3 หลายเดือนก่อน

    I have been searching for 1.1 weeks for my problem to be just this. thank you sir

  • @sinchanagowda8302
    @sinchanagowda8302 หลายเดือนก่อน

    bro whoever you are, god bless you! I finally made my vscode run..

  • @SakacOyuncu
    @SakacOyuncu 3 หลายเดือนก่อน

    bro I have been trying to solve this problem for 2 hours and your video fixed it thank you

  • @kairu7815
    @kairu7815 หลายเดือนก่อน

    A simple solution the headache that it gave me looking for simple solution.

  • @NidhiKumari-yr6hz
    @NidhiKumari-yr6hz 3 หลายเดือนก่อน

    Thank you so much bhaiya .I have been searching for its solution from a week .Finally I can code now.

  • @lilstarkgaming6142
    @lilstarkgaming6142 5 หลายเดือนก่อน

    Thank you I’ve been trying to figure this bs out for a minute now 💆🏻‍♂️

  • @AnjaliGupta-1503
    @AnjaliGupta-1503 5 หลายเดือนก่อน

    Sir but how can i delete my vscode folder because there is many files existing in that .

    • @learnwithajit29
      @learnwithajit29  5 หลายเดือนก่อน

      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.

  • @mohitchamyal4852
    @mohitchamyal4852 8 หลายเดือนก่อน +1

    Sir this compiler can't download in my pc , what can i do 😭

    • @Zoidyhere
      @Zoidyhere 4 หลายเดือนก่อน

      download kar phir

  • @Coding-h5v
    @Coding-h5v 7 หลายเดือนก่อน

    Finally after weeks it's solved for me

  • @Milkdane
    @Milkdane 8 หลายเดือนก่อน

    I did same but it dosen't work

    • @learnwithajit29
      @learnwithajit29  8 หลายเดือนก่อน +1

      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.

  • @mohitchamyal4852
    @mohitchamyal4852 8 หลายเดือนก่อน

    Sir this aap can't run in my pc , 😔 what can i fo ?

    • @learnwithajit29
      @learnwithajit29  8 หลายเดือนก่อน

      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.

    • @mohitchamyal4852
      @mohitchamyal4852 8 หลายเดือนก่อน

      Sir yesterday i used build file extension in c/c++ extension, after that I face error in every code in visual studio

  • @wheatus520
    @wheatus520 3 หลายเดือนก่อน

    Thank you sir, it really helpful.

  • @abins641
    @abins641 หลายเดือนก่อน

    Thank you, you are a life saver. ..

  • @Knowledge_Spread
    @Knowledge_Spread หลายเดือนก่อน

    This video is very helpful for me , thanks you

  • @akhadjan
    @akhadjan 9 หลายเดือนก่อน

    Thank you for video, keep going

  • @giannisp7808
    @giannisp7808 4 หลายเดือนก่อน

    does this work on mac;

    • @prodigious029
      @prodigious029 4 หลายเดือนก่อน

      I hope it will!

  • @DhiyaneshwarVedagiri
    @DhiyaneshwarVedagiri 2 หลายเดือนก่อน

    God bless you!

  • @adarshkumar3521
    @adarshkumar3521 12 วันที่ผ่านมา

    Thanku Bhai working ❤❤❤❤

  • @vaibhavtubachi8736
    @vaibhavtubachi8736 18 วันที่ผ่านมา

    thanks it worked

  • @feelink5197
    @feelink5197 หลายเดือนก่อน

    thanks a lot

  • @uncle_1037
    @uncle_1037 4 หลายเดือนก่อน +1

    thnx saar

  • @MrIncredible1495
    @MrIncredible1495 4 หลายเดือนก่อน

    Thank you

  • @savvaspi6265
    @savvaspi6265 8 หลายเดือนก่อน

    it does not work for me what can i do?

    • @learnwithajit29
      @learnwithajit29  8 หลายเดือนก่อน

      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.

    • @learnwithajit29
      @learnwithajit29  8 หลายเดือนก่อน

      And also check whether you have installed compilers properly.

  • @HiếuPhạmHoàng-n9b
    @HiếuPhạmHoàng-n9b 4 หลายเดือนก่อน

    thanks you so much

  • @gagan_.hegde14
    @gagan_.hegde14 8 หลายเดือนก่อน

    Thanks bro hope that msys2 is safe cause my defender is giving warning

    • @learnwithajit29
      @learnwithajit29  8 หลายเดือนก่อน

      Yes it is safe to use. No worries.

  • @Kriptane
    @Kriptane หลายเดือนก่อน +1

    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.

  • @MostafaAhmedOsman
    @MostafaAhmedOsman 8 หลายเดือนก่อน

    thank you man i finally founded the solution from you after a lot of timmmme thanks brooooo

    • @satyamrawat4079
      @satyamrawat4079 8 หลายเดือนก่อน

      Bro i am still getting the same error. What you have done more?

    • @learnwithajit29
      @learnwithajit29  8 หลายเดือนก่อน +1

      ​@@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.😢

  • @stevenogbuehi3846
    @stevenogbuehi3846 หลายเดือนก่อน +3

    This does not work. It just keeps recreating that vscode thing I deleted

  • @hanzwer
    @hanzwer 6 หลายเดือนก่อน

    thank you

  • @AlexNas-eh9cm
    @AlexNas-eh9cm 22 วันที่ผ่านมา +2

    Whatever I do I still I get a message in the terminal what the terminal process terminated with edit code -1

    • @Mihiatza_1
      @Mihiatza_1 8 วันที่ผ่านมา

      same bro

  • @thejadaramirez
    @thejadaramirez 5 หลายเดือนก่อน +3

    Thank you so much! I have been struggling with this for so long and couldn't find an answer. I appreciate you!

  • @terraa-1375
    @terraa-1375 7 หลายเดือนก่อน +4

    You are incredible man! Huge Thanks.

  • @minhtoanhuynh6768
    @minhtoanhuynh6768 18 วันที่ผ่านมา

    thanks, I might have chosen the wrong compiler or sth (gcc). So delete .vscode and choose g++ solved the problem.

  • @mr.twente7
    @mr.twente7 5 วันที่ผ่านมา

    Thanks alot bro ❤

  • @cindy_yogurt
    @cindy_yogurt 23 วันที่ผ่านมา

    it works

  • @baris0990
    @baris0990 2 หลายเดือนก่อน

    thank you vro

  • @lowendgamer3107
    @lowendgamer3107 25 วันที่ผ่านมา

    Tnquuu

  • @maninderramgharia1891
    @maninderramgharia1891 3 หลายเดือนก่อน +1

    folder not deleted ............. after deleted still showing
    not helpful

    • @sumyaerfan6205
      @sumyaerfan6205 2 หลายเดือนก่อน

      could you fix the problem using any other way?

    • @maninderramgharia1891
      @maninderramgharia1891 2 หลายเดือนก่อน

      ​@@sumyaerfan6205Yes ma'am
      Make .exe file of same program file and then execute the same

  • @nlxair9107
    @nlxair9107 หลายเดือนก่อน

    Lov U BRO ♥

  • @Mark71697
    @Mark71697 3 หลายเดือนก่อน

    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.

  • @fikrisalim878
    @fikrisalim878 2 หลายเดือนก่อน

    Just talked with my ChatGPT and yes it give me a great solution but this guy give me easier way to fix it

  • @javierguevara649
    @javierguevara649 18 วันที่ผ่านมา

    Thanks man! This was an easy fix but I struggle for hours. 😂

  • @badalgugnani9876
    @badalgugnani9876 9 หลายเดือนก่อน

    Thanku it worked...
    I found this video after apply several method... And none of them work.. But it did 🥰✨...

  • @mohsennorouzi306
    @mohsennorouzi306 หลายเดือนก่อน

    i love you and thank you

  • @AkiyamaMio-q8b
    @AkiyamaMio-q8b 3 หลายเดือนก่อน

    thank you very much

  • @ZakirKhan-jz4ey
    @ZakirKhan-jz4ey 3 หลายเดือนก่อน

    Thankyou brother

  • @Ironpecker
    @Ironpecker 6 หลายเดือนก่อน

    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

  • @kool-aid3243
    @kool-aid3243 8 หลายเดือนก่อน +3

    1 solution that worked for me was deleting the .vscode folder from my project folder and then running the code afterwards. Hope this helps!

  • @akhadjan
    @akhadjan 9 หลายเดือนก่อน

    can you share your theme name?

    • @learnwithajit29
      @learnwithajit29  9 หลายเดือนก่อน +1

      Install the Rainglow theme and select the Azure (Rainglow) from drop-down...😊