vs code launch program 'enter program name' does not exist - c

launch program 'enter program name' does not exist error
i viewed some videos on youtube they told me to install mingw but the folder they mention does not exist in mingw v10

Related

netbeans8.2 + msys2_64 + mingw64 + cygwin64 + C project build errors

On new HP tower G4 workstation with Xeon E2224G processor, Windows 10 pro for wokstations OS build 19042.746.
install netbeans 8.2
Install msys2_64 and mingw64
set path e:\msys64\usr\bin; e:\msys64\mingw64\bin; %PATH%
Verify that make,sh,bash,rm and more are in e:\msys64\usr\bin
configure netbeans for C project and try to clean and build and get this error:
'No shell found. Cannot proceed. Please install either CYGWIN or Msys.'
OK then, install cygwin.
Now get this error:
'1 [main] rm (7980) E:\cygwin64\bin\rm.exe: *** fatal error - cygheap base mismatch detected - 0x180345408/0x180347408.'
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
cygcheck -c gives
base-cygwin 3.8-1 OK
base-files 4.3-2 OK
cygwin 3.1.7-1 OK
I have searched and there is only one cygwin1.dll
frank#FRANK_NEW ~
$ which cygwin1.dll
/usr/bin/cygwin1.dll
I have restarted the machine several times to no avail.
I have been using netbeans and mingw then msys/mingw for about 10 years and
have the combination working on other desktop and laptop machines, but have
not had this problem.
Thanks for the replies above. The problem here is the different ways that PATH is handled by Windows 10 Pro and Windows 10 Pro for Workstations.
For Win10 Pro
define a user variable 'MSYS_HOME' give it a value of 'E:\msys64\usr\bin'
now put that in the system path i.e.
some system path;%MSYS_HOME%;more system path
Netbeans will find the tools rm, sh, make, etc and complete the clean and build of the project.
for Win10 Pro for Worksations
the above did not work. Netbeans would not build the project and give the error
'No shell found. Cannot proceed. Please install either CYGWIN or Msys.'
the path has to be set in the system path directly i.e.
some system path;E:\msys64\usr\bin;more system path
this made Netbeans work correctly to perform clean and build.

run C++ compiler via batch file

I want to start learning C so started reading "C for dummies". It asked me to create a batch file that runs the gcc command that runs the compiler (Dev-C++).
I managed to create a gcc.bat file in c:\windows using the command "copy con gcc.bat". In this file I inserted the path name and details as in the book using the terminal, which is "#c:\Dev-C++\bin\gcc %1 %2 %3 %4 %5 %6"
(I made sure the pathname is similar to the path in which Dev-C++ is installed)
Now to check if it is installed properly I went to another folder and typed "gcc -v",
however it returns "the system cannot find the path specified".
Can you help me what I did wrong?
Many thanks :)
Dev-C++ is old. I used it myself many years ago, but then I discovered Code::Blocks (http://codeblocks.org/) which I still use today.
As for gcc running in the Command Prompt, you could just run this as the first command:
SET PATH=C:\Dev-C++\bin;%PATH%
After that you can just run gcc in the prompt.
A more recent version of GCC for Windows is available at http://winlibs.com/. Instructions on how to use it from console and Code::Blocks are on the website.

New to C: Compiling in Visual Studio Code... error: gcc not recognized?

I am very new to coding (trying to teach myself C). I have some experience with MatLab, but I understand it is very different from C. I have Windows 10 with the newest version of Visual Studio Code (VSC) with the Run Code Extension and git extension (not sure what git does, but VSC prompted me to install). I am now familiar with the text editor, but do not know how to compile/run my code (apologies if I'm butchering the terminology, again, a newby). One friend recommended I determine the location in which the desired text file is located, type "gcc filename.c", enter, type "./a.out", and then the program should run. (Said friend has a Mac and I supposed the execution commands are different?) Regardless, I encountered "Run Code" extension on my google adventures and follow the steps I've seen online, but I am still getting the error pictured.
I can see how this would be an especially basic question, but if anyone can offer assistance/advice, I would be extremely grateful!
Thanks, All.
Sandy
P.S. In case the image doesn't load/work for whatever reason, this is the error:
"'gcc' is not recognized as an internal or external command,
operable program or batch file."
Works perfect in Visual Code. You need the following:
C/C++ extension in Visual Code.
msys64 installed in C:\
Add path to msys64 bin folder in environment variable
Instructions:
https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
Important the msys64 path doesn't contain spaces so don't install it in Program Files.
You can search "Edit system environment variables" from the windows button, press button Environment Variables, and then add it as a System variable "Path". For me its located in
C:\msys64\mingw64\bin
Hey,,,
It will work for you I believe
Blockquote
First: open the link: https://www.msys2.org/
Go to the installation and download the installer .. install the exe file.
search mingw in windows search(windows start)
there is an app named--> MSYS2 MinGW {64/32}-bit
run it as administrator
Found command shell ---> type: pacman -Syu
Will ask you for some installation click on Y
Then again go to the same app MSYS2 MinGW {64/32}-bit and run as admin
and write--> pacman -Ss gcc (in shell that opend after click)
after clicking there will be bunch of things and now you have to care about your windows arch.. if it is 64 bit then write---> pacman -S mingw-w64-x86_64-gcc (and if its 32 you will find something like that where 64 will replaced by 32 in bunch of commands that are showing in your shell)
after executing this command gcc will be installed in your system to check write: gcc --version || g++ --version
After that to install the debugger write pacman -S mingw-w64-x86_64-gdb
to check write: gdb --version
**Every thing got installed in your system now find the mingW file or mysys2 file on C drive(whereever you r mingW file got saved) go the the minGW 64 || 32 accroding to your operating system there is a bin folder click on that and copy the path inside the bin folder and save it in environment variables path **
Blockquote
Enjoy vs code
My recommendation
You are on Windows right? So you can just install Visual Studio IDE (follow this tutorial). Which is better than vs code. This tutorial is for C++ but it works for C as well. Because C++ uses the same compiler as C but with some more things(simple explanation).
The solution for your problem
You are getting the massage 'gcc' is not recognized as an internal or external command, operable program or batch file because you do not have the gcc compiler installed on your computer. But if you want to install it, you can follow this tutorial. But I highly recommend you use Visual Studio IDE which I mentioned above.
Type gcc --version in the command prompt to check whether the C compiler is installed in your machine.
If it is installed then try adding gcc to the environment variables using this link:
https://www.youtube.com/watch?v=qLh84CmdBJ0
If it is not installed then install it using instructions using this link:
https://www.guru99.com/c-gcc-install.html
and then add it to the environment variables using the link above.
If it is installed and not recognized by VSCode then try to run VSCode from CMD by typing code in CMD.

Eclipse will not run C programs

I just recently installed the CDT plugin for Eclipse in Windows 8 and I'm getting the error:
"Launch failed. Binary not found."
Now I've looked into this and I have installed cygwin with gcc and set that up in Eclipse settings. I went to Window>Preferences>New C/C++ Project Wizard>Makefile Project and checked Cygwin PE Parser (and just in case I checked PE Windows Parser as well).
Then I went to Window>Preferences>Build>Environment and added my PATH variable there. I made sure to add C:\cygwin64\bin to my PATH in my system settings, and I know this is valid because I checked that location and I have successfully run gcc through the command line as well as the cygwin terminal. On top of this, if I build my project in Eclipse and then navigate to that directory outside of Eclipse and run the .exe that it creates by double-clicking on it, it also runs properly.
I'm at a loss for why Eclipse can't run it but everything else can...Any suggestions?
right click your project in eclipse "project explore" -> Run as -> Run configuration
=>select your project name then check "Main" tab, in C/C++ application file. is it point to your binary file?
E.g:
Debug/TestProj.exe

No binary found Eclipse

The problem:
No includes folder in the project folder.
Error: "Launch failed. Binaries not found"
I'm writing my first C code on Eclipse (new to Eclipse) but cant seem to run it. When I create a new project like so file->new->c project-> choose empty project and MinGW in toolchains and finish.
There I end up with a empty folder and no include folder. From there i create a new src folder and a .cpp file, then i "build all" the code first then run it. After all that i end up with Launch failed. Binaries not found. I also checked that PE Windows Parser is on. Also this line is underlined red:
#include <iostream>
What am i missing ?
As mentioned in this thread:
If the toolchains show up in "Create C++ project of selected type", then Eclipse has detected them correctly.
The message "Launch failed,binaries not found" means that Eclipse cannot find the application you want to debug/launch! Most of the times this message appears when you forget to build your project before launching or build errors occurred. This can be compiler errors in your code or a missing/wrongly installed toolchain.
So, when you build "hello world", check the output visible in the Console Window in Eclipse.
If the build fails because of:
Error launching external scanner info generator (gcc -E -P -v -dD)
, then see "Error Launching external scanner info generator - gcc link problem on MingGW".

Resources