@@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
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.
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.
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.
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 !! 😉
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.
@@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.
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.
Super simple and helpful... just like it should be. Great job explaining!
ld: Undefined symbols: _main, referenced from: clang: error: linker command failed with exit code 1 (use -v to see invocation)
i am getting the same error bro. have you found any solution for it?
@@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
@@epicgame8194 Me too. Have you found an a solution yet?
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.
@@epicgame8194 nope bro
Why there's nothing in the "Output when my code run. Beside my code still showned in the terminal. Thank you
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
Did you solve this problem?
so simple and well explained!! Thanks for share
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.
Had the same problem with code runner not behaving as shown in the video. Thanks for this!
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.
you're a real one bro
Guys, how to fix "Errors exist after running preLaunchTask 'C/C++: clang ?
Did you find the solution to this?
big respect from russian boy! Thaaaanks
Thanks, bro :D
It display 150 hours for standby time, after i wrote xcode-select --install. Is it normal???
MANY THANKS!
Glad it was helpful!
Please, make a guide, how to use custom libraries, I can't find out, how to do it on macOS((
The preLaunchTask ‘C/C++: clang build active file’ terminated with exit code -1.
thanks bro
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 !! 😉
Thanks so much!
Hello
I've tried doing this but instead of showing my output "Hello World" I got "Activating task providers cppbuild" instead. Why?
just close and re open vs code, it worked for me
thank you so much
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.
ty bro
fuck yeah. im an engineer now.
it still says command not found could u guide please?
Before you run the code make sure to save the file first then run the code and it should work.
I cannot type whenever I use "cin >>"
me too, im trying to figure thqt out aswell :(
me 2, facing the same problem
Have you figured it out ?
@@kalaiselvan5257 I did, but I don’t remember how. I will set it up on my new laptop and I’ll let you know
@@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.
thanks for the tutorial
Why does this just work in "Hello World"?
Super simple and helpful... just like it should be. Great job explaining!
Thank you so much
Good, thank you!