How to Run C++ in VS Code on MacOS

Поделиться
HTML-код
  • Опубликовано: 24 дек 2024

Комментарии • 52

  • @Heisenberg-cf1wg
    @Heisenberg-cf1wg 9 месяцев назад +3

    men thanks realy, i comming to mac from windows and dont know how to close the program... you realy help me to continue learn c++ on mac.

  • @makoakaleo4653
    @makoakaleo4653 Год назад +1

    Super simple and helpful... just like it should be. Great job explaining!

  • @Chaitanya_Shedge
    @Chaitanya_Shedge 11 месяцев назад +20

    ld: Undefined symbols: _main, referenced from: clang: error: linker command failed with exit code 1 (use -v to see invocation)

    • @epicgame8194
      @epicgame8194 7 месяцев назад +2

      i am getting the same error bro. have you found any solution for it?

    • @zaloskog
      @zaloskog 7 месяцев назад

      ​@@epicgame8194 try just running it using "⌃⌥p", it will go into the output panel. Otherwise if you need to compile it do so through the terminal, you can look up how to and it isn't very difficult

    • @deathscorch3595
      @deathscorch3595 5 месяцев назад

      @@epicgame8194 Me too. Have you found an a solution yet?

    • @sohamb4944
      @sohamb4944 5 месяцев назад +1

      I don't know why clang doesn't work. I typed g++ instead and then it just did work. g++ should come apart of xcode command line tools if you did install clang through that.

    • @Chaitanya_Shedge
      @Chaitanya_Shedge 5 месяцев назад

      @@epicgame8194 nope bro

  • @hoangvuong9008
    @hoangvuong9008 Год назад +5

    Why there's nothing in the "Output when my code run. Beside my code still showned in the terminal. Thank you

  • @coolbirdez
    @coolbirdez 10 месяцев назад +2

    Hi bro. Got the problem : "The preLaunchTask 'C/C++: clang build active file' terminated with exit code -1.". Any idea how to solve? Thank you

  • @antonioterron2252
    @antonioterron2252 Год назад

    so simple and well explained!! Thanks for share

  • @aryamandarda7654
    @aryamandarda7654 5 месяцев назад +2

    I installed both extensions like you said but when I click run, the search bar on top asks me to select a debug configuration. It was not as easy as just clicking run and debug. I had .vscode folder auto generate with tasks.json and launch.json where I had to change the command configuration from ""/usr/bin/clang" to ""/usr/bin/clang++" manually. I doubt code runner is doing what needs to be done. Any solutions to this pain point would be greatly appreciated.
    When fixing all these issues and running, my "Hello world" comes in the debug console and not in the output console. VERY WEIRD and I am sure I have messed my VS code enough in the past years to encounter this problem.

    • @katrina-kayalaimo4960
      @katrina-kayalaimo4960 5 месяцев назад

      Had the same problem with code runner not behaving as shown in the video. Thanks for this!

  • @stonechen4089
    @stonechen4089 6 месяцев назад

    which c++ standard is applied to your g++ or clang by default? Mine is 199711 which is ancient. And I know I can pass in the flag to set it to a modern one with -std=c++20, but I wonder if I did anything wrong.

  • @georgemahfood8743
    @georgemahfood8743 Год назад

    you're a real one bro

  • @周琨淏
    @周琨淏 Год назад +3

    Guys, how to fix "Errors exist after running preLaunchTask 'C/C++: clang ?

    • @torpidfella293
      @torpidfella293 9 месяцев назад

      Did you find the solution to this?

  • @redd1ee845
    @redd1ee845 5 месяцев назад

    big respect from russian boy! Thaaaanks

  • @Pixel_Andrew
    @Pixel_Andrew 6 месяцев назад +1

    Thanks, bro :D

  • @Imparavitor
    @Imparavitor Год назад +1

    It display 150 hours for standby time, after i wrote xcode-select --install. Is it normal???

  • @maryyyyaaa
    @maryyyyaaa 8 месяцев назад +1

    MANY THANKS!

  • @folium5725
    @folium5725 Год назад +1

    Please, make a guide, how to use custom libraries, I can't find out, how to do it on macOS((

  • @torpidfella293
    @torpidfella293 9 месяцев назад

    The preLaunchTask ‘C/C++: clang build active file’ terminated with exit code -1.

  • @mahmoudsalah5359
    @mahmoudsalah5359 11 дней назад

    thanks bro

  • @frei-math-quantum
    @frei-math-quantum Год назад +3

    This setup tutorial is so simple 😊
    => should hopefully get much more likes (and being pushed on youtube)
    Thanks a lot for this very nice introduction !! 😉

  • @tomriddle7854
    @tomriddle7854 3 месяца назад

    Hello
    I've tried doing this but instead of showing my output "Hello World" I got "Activating task providers cppbuild" instead. Why?

    • @AlphaSow0
      @AlphaSow0 3 месяца назад

      just close and re open vs code, it worked for me

  • @abdurrahman89876
    @abdurrahman89876 Год назад

    thank you so much

  • @stevenhuff4914
    @stevenhuff4914 Год назад +2

    Anyone have clarification on the .run extension for me please?
    I ask because I've been working on vscode for about a week now after starting a course to expand my c++ skills. The issue I've had is with the running of the code. I installed the c/c++ extension and that was it. The instruction didn't say anything else and I kept getting an error regarding the a.out file which I assume is the compiled executable or something like that.
    I was on stack overflow when someone rudely told me to read the vs code manual and that I needed to set up prelaunch tasks. I was watching videos on prelaunch task setup when I realized that they all have different steps, missing steps, different versions, different OS etc.. I could never get the desired outcome.
    Now, I come across this video and the only thing that's different is that I installed the .run extension. Runs code fine. However, the description says it runs "CODE SNIPPET". To me this sounds like its for small code files... maybe its just the chosen description, but I wonder if this completely takes care of the prelaunch requirements (with respect to JSON file) or do I still need to have that set up.
    If I do need to set up the JSON configuration still, could someone please point me to an in-depth walkthrough to do this? I have a late 2017 MacBook Pro. Everything I've found implies I have strong working knowledge of VS, though I typically use basic editors when learning and have never used a program as complex as this for the task.
    Sorry for the long post, and thanks in advance for any helpful comments or direction regarding this matter.

  • @aktanbro8015
    @aktanbro8015 Год назад

    ty bro

  • @dan110024
    @dan110024 8 месяцев назад +1

    fuck yeah. im an engineer now.

  • @duawahabkhan
    @duawahabkhan Год назад

    it still says command not found could u guide please?

    • @domino3689
      @domino3689 11 месяцев назад

      Before you run the code make sure to save the file first then run the code and it should work.

  • @dragoongalaxy20
    @dragoongalaxy20 Год назад +1

    I cannot type whenever I use "cin >>"

    • @domino3689
      @domino3689 11 месяцев назад +2

      me too, im trying to figure thqt out aswell :(

    • @Leon-zw7rr
      @Leon-zw7rr 11 месяцев назад +2

      me 2, facing the same problem

    • @kalaiselvan5257
      @kalaiselvan5257 10 месяцев назад

      Have you figured it out ?

    • @dragoongalaxy20
      @dragoongalaxy20 10 месяцев назад

      @@kalaiselvan5257 I did, but I don’t remember how. I will set it up on my new laptop and I’ll let you know

    • @kalaiselvan5257
      @kalaiselvan5257 10 месяцев назад

      @@dragoongalaxy20 you can actually give input in terminal window but not in output window, if you remember how you got to do in output, please tell me.

  • @whogashaga
    @whogashaga Год назад

    thanks for the tutorial

  • @Leon-zw7rr
    @Leon-zw7rr 11 месяцев назад

    Why does this just work in "Hello World"?

  • @makoakaleo4653
    @makoakaleo4653 Год назад +1

    Super simple and helpful... just like it should be. Great job explaining!

  • @gary1679
    @gary1679 Год назад +1

    Thank you so much

  • @dragonball41876
    @dragonball41876 3 месяца назад

    Good, thank you!