microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.51k stars 1.55k forks source link

Unable to run C program file. #5563

Closed AGoh2019 closed 4 years ago

AGoh2019 commented 4 years ago

Type: General

Unable to run C program file

Describe the bug

To Reproduce Please include code sample and task.json files. Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen. Expect it to show on terminal - Welcome to C Programming

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Basically, I am looking for a plug-in solution.

michelleangela commented 4 years ago

@AGoh2019 Are you looking for an extension to compile a C program file? The C/C++ extension only provides IntelliSense information and debugging. It does not have compiling features.

Also, where would Welcome to C Programming come from?

For this issue, is this from IntelliSense or compiling?

unable to recognise #include and printf statement

AGoh2019 commented 4 years ago

Hi Michelle, Then where can I find compiling features for the languages that I have added into VS Code? Regards, Andrew Goh S M

On Thursday, 28 May 2020, 02:54:14 am GMT+8, Michelle Matias <notifications@github.com> wrote:  

@AGoh2019 Are you looking for an extension to compile a C program file? The C/C++ extension only provides IntelliSense information and debugging. It does not have compiling features.

Also, where would Welcome to C Programming come from?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

michelleangela commented 4 years ago

I do not know of any extension that does automated C or C++ compiling for VS Code. The C/C++ extension does have helloworld tutorials that go over how to create tasks.json for VS Code to execute compiler commands. This one example goes over how to create a tasks.json if you are using a GCC compiler on a Linux machine.

AGoh2019 commented 4 years ago

I am using a Windows computer.  As for creating tasks.json files.  Can't Microsoft make the process easier for a automated compiling feature in VS Code? Andrew Goh S M

On Thursday, 28 May 2020, 07:47:17 am GMT+8, Michelle Matias <notifications@github.com> wrote:  

I do not know of any extension that does automated compiling for VS Code. The C/C++ extension does have helloworld tutorials that go over how to create tasks.json for VS Code to execute compiler commands. This one example goes over how to create a tasks.json if you are using a GCC compiler on a Linux machine.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

AGoh2019 commented 4 years ago

Eclipse Theia is making its desktop and online IDE work out of the box.  I hope that Microsoft can make a major upgrade for VS Code, without messing around with json configuration files.  As far as I am concerned, I would like to use VS Code to learn the following languages in the years ahead: C, C++, Java, Python, Perl, Ruby, C#, F#, Julia. Regards, Andrew Goh S M

On Thursday, 28 May 2020, 07:56:42 am GMT+8, Andrew Goh <andrewgoh95@yahoo.com.sg> wrote:  

I am using a Windows computer.  As for creating tasks.json files.  Can't Microsoft make the process easier for a automated compiling feature in VS Code? Andrew Goh S M

On Thursday, 28 May 2020, 07:47:17 am GMT+8, Michelle Matias <notifications@github.com> wrote:  

I do not know of any extension that does automated compiling for VS Code. The C/C++ extension does have helloworld tutorials that go over how to create tasks.json for VS Code to execute compiler commands. This one example goes over how to create a tasks.json if you are using a GCC compiler on a Linux machine.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

michelleangela commented 4 years ago

VS Code is intended to be an editor and not an IDE to keep it light weight (in terms of CPU, memory consumption, and storage size), and it is highly customizable with extensions for different languages. The VS Code community does create extensions for VS Code to add capabilities to it. When using VS Code, the user can customize what extensions to use for their code development, such as which IntelliSense extension and which build system extensions to use. For C/C++, you can try the cmake extension to build your project with cmake, where you would need to create cmakelist.txt files to configure cmake on how to compile and build a project. For simple projects though where not a lot of configuration is required for compiling and building, the tasks.json is usually used on VS Code. Also, VS Code does not ship with a compiler (except it can compile Typescript out of the box), so you would need to ensure you have the correct compiler installed for your project, and specify that compiler in the tasks.json.

If you would you like a fully automated IDE experience, you can use Visual Studio IDE, which installs the Microsoft C++ compiler when you install the C++ development component for it.

AGoh2019 commented 4 years ago

That means VS Code is no better than Notepad++ or SciTE. Why can't VS Code be modified to detect a compiler and a linker which can be downloaded and stored in its own directory.  In any case, VS IDE provides me with access to C, C++, Java, Python, JavaScript, TypeScript, C# and F# but not for Perl, Ruby, Racket or Lisp which I would learn in the future. Andrew Goh S M

On Thursday, 28 May 2020, 08:18:48 am GMT+8, Michelle Matias <notifications@github.com> wrote:  

VS Code is intended to be an editor and not an IDE to keep it light weight (in terms of CPU, memory consumption, and storage size), and it is highly customizable with extensions for different languages. The VS Code community does create extensions for VS Code to add capabilities to it. When using VS Code, the user can customize what extensions to use for their code development, such as which IntelliSense extension and which build system extensions to use. For C/C++, you can try the cmake extension to build your project with cmake, where you would need to create cmakelist.txt files to configure cmake on how to compile and build a project. For simple projects though where not a lot of configuration is required for compiling and building, the tasks.json is usually used on VS Code. Also, VS Code does not ship with a compiler (except it can compile Typescript out of the box), so you would need to ensure you have the correct compiler installed for your project, and specify that compiler in the tasks.json.

If you would you like a fully automated IDE experience, you can use Visual Studio IDE, which ships with a compiler.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

AGoh2019 commented 4 years ago

Meanwhile, I am learning four languages right now - C, Java, Python and SQL (SQLite). The Python module worked but not correctly. Microsoft Java asked me to point to a JDK which I had done with jGrasp, don't know why its invalid. C won't run unless I download a huge compiler. Why doesn't it recognise MinGW which had been installed. Regards, Andrew Goh S M

On Thursday, 28 May 2020, 11:08:48 am GMT+8, Andrew Goh <andrewgoh95@yahoo.com.sg> wrote:  

That means VS Code is no better than Notepad++ or SciTE. Why can't VS Code be modified to detect a compiler and a linker which can be downloaded and stored in its own directory.  In any case, VS IDE provides me with access to C, C++, Java, Python, JavaScript, TypeScript, C# and F# but not for Perl, Ruby, Racket or Lisp which I would learn in the future. Andrew Goh S M

On Thursday, 28 May 2020, 08:18:48 am GMT+8, Michelle Matias <notifications@github.com> wrote:  

VS Code is intended to be an editor and not an IDE to keep it light weight (in terms of CPU, memory consumption, and storage size), and it is highly customizable with extensions for different languages. The VS Code community does create extensions for VS Code to add capabilities to it. When using VS Code, the user can customize what extensions to use for their code development, such as which IntelliSense extension and which build system extensions to use. For C/C++, you can try the cmake extension to build your project with cmake, where you would need to create cmakelist.txt files to configure cmake on how to compile and build a project. For simple projects though where not a lot of configuration is required for compiling and building, the tasks.json is usually used on VS Code. Also, VS Code does not ship with a compiler (except it can compile Typescript out of the box), so you would need to ensure you have the correct compiler installed for your project, and specify that compiler in the tasks.json.

If you would you like a fully automated IDE experience, you can use Visual Studio IDE, which ships with a compiler.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

sean-mcmanus commented 4 years ago

Our extension should be able to detect MinGW if you have it installed at a location we can find. You may need to remove "shell: " from the tasks "label" to get F5 to work due to a bug that should be fixed in our next release. If your MinGW path has spaces in it, you may get a failure, due to a VS Code bug, but it works on VS Code Insiders. If you can provide more info on what compiler you're using, the tasks.json, and lauch.json, and what errors you're hitting that would help diagnose any other issues you have.

AGoh2019 commented 4 years ago

Hi Sean, I have decided to use VS IDE instead, and ditch VS Code.  Thanks for your time. Regards, Andrew Goh S M

On Saturday, 30 May 2020, 09:45:32 am GMT+8, Sean McManus <notifications@github.com> wrote:  

Our extension should be able to detect MinGW if you have it installed at a location we can find. You may need to remove "shell: " from the tasks "label" to get F5 to work due to a bug that should be fixed in our next release. If your MinGW path has spaces in it, you may get a failure, due to a VS Code bug, but it works on VS Code Insiders. If you can provide more info on what compiler you're using, the tasks.json, and lauch.json, and what errors you're hitting that would help diagnose any other issues you have.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

AGoh2019 commented 4 years ago

Hi Sean, Eclipse provides a full list of extensions in addition to C, C++, Java, Python, C# and Web development tools, such as Perl, Clojure/Common Lisp, Ruby, Julia, OCaml and Prolog.  

I just wonder why can't VS IDE do the same.  Regards, Andrew Goh S M

On Saturday, 30 May 2020, 12:40:14 pm GMT+8, Andrew Goh <andrewgoh95@yahoo.com.sg> wrote:  

Hi Sean, I have decided to use VS IDE instead, and ditch VS Code.  Thanks for your time. Regards, Andrew Goh S M

On Saturday, 30 May 2020, 09:45:32 am GMT+8, Sean McManus <notifications@github.com> wrote:  

Our extension should be able to detect MinGW if you have it installed at a location we can find. You may need to remove "shell: " from the tasks "label" to get F5 to work due to a bug that should be fixed in our next release. If your MinGW path has spaces in it, you may get a failure, due to a VS Code bug, but it works on VS Code Insiders. If you can provide more info on what compiler you're using, the tasks.json, and lauch.json, and what errors you're hitting that would help diagnose any other issues you have.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

sean-mcmanus commented 4 years ago

I don't know. You'd have to ask the VS team (maybe a follow up to https://developercommunity.visualstudio.com/idea/524471/programming-language-extensions.html). I guess no one has decided to write a VS extension for those languages yet.

github-actions[bot] commented 4 years ago

This issue has been closed automatically because it's labeled as a 'question' and has not had recent activity.