Debug not working on CS50 practice problem - c

Trying to do CS50 week 1 practice problem "Debug'. I've followed it step by step repeatedly for hours and cant seem to get away from this error.
When I 'make' debug, I get an error saying
The term 'make' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again..
I can run Debug on code.cs50.io, but I'm unable to run debug on the actual VS Code App on windows 11. I tried to copy paste the code itself into code.cs50.io but I get this error
make debug
debug50 ./debug
Can't debug this program! Are you sure you are running debug50
on an executable, a Python script, or a Java program?
Unsupported File: ./debug
I am very new to VS Code and coding in general, so can someone please explain this to me ?

I did cs50 but it was a couple of years ago. I can’t remember if I did it on windows or linux. Anyway, I think the clue here is:
The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again..
If you have not installed make then you have to install it.
Try here:
https://stackoverflow.com/a/57042516/11112270
If you do have it installed, then the binary executable is not in $PATH env variable.
Try here:
https://stackoverflow.com/a/44958882/11112270
IMO, just develop on linux since it’s much easier to get tools you need. Unless cs50 requires windows?

Related

Makefile not working, path not found to 'make' command

Im a first year university student learning how to use makefiles to compile and run my simple program. I set it up as instructed but when i type in "make" it pops up this error:
The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
Tried checking the path and uninstalled and reinstalled minGW using the installer. Should i try installing the gcc compiler a different way? Please keep in mind im pretty new to this stuff. Using C btw.
MinGW is just the compiler tools. But usually it comes with mingw32-make.
So you would try that, but the location of the MinGW .exe files you are trying to run must be in the PATH environment variable or it won't find them.
If you want to run make like they do on Linux/Unix I recommend you install MSYS2 shell from https://www.msys2.org/
Quick answer:
Use mingw32-make instead of make after installing mingw
If you don't have "make" command follow steps;
(First, make sure you have installed choco)
Run PowerShell as administrator
choco install make

'"./testing"' is not recognized as an internal or external command, operable program or batch file

so I'm trying to run a c program on a compiler called geany but keep running on to this error whenever I try and run the program. I know there isn't any mistake on the actual code as I am able to compile it. I am also able to run it on online IDE's. It just will not run on an IDE on my computer. I've tried visual studio, and another third party ide and I am still getting a similar error.

Calling Windows 10 bash from a c program

I am trying to write a simple program that would parse some string and pass it to bash on Windows 10 (with the not-so-new Linux subsystem). So I try
system("bash");
(in the actual program I include some arguments for bash, but it behaves the same with or without them)
I get this error when the program launches:
'bash' is not recognized as an internal or external command, operable program or batch file.
I found this error is often caused by unset path variable, but it seems to be fine when I checked and I can launch bash from the command line without problem. I am using Visual Studio Express for desktop.
Update: calling dir C:\Windows\System32 from cmd gives 4142 results, while running system("dir C:\\Windows\\System32"); code in c gives 2839. Apparently it is not just bash the program can't see. Why is it so? Why does it not see these files?
Finally found the problem - file system redirector had been causing the trouble. Using the C:\Windows\Sysnative\bash path works.
Thanks to all that tried to help.

Geany compiling

Don't know where to put this...
But I'm running Geany on 2 systems (laptop and desktop). On my laptop it works perfectly, but on my desktop when I run the code i get this error:
'"./whatevername"' is not recognized as an internal or external command, operable program or batch file
I can't figure out wtf is wrong with it. Any ideas?
If I may give a small help: you need to set the PATH variable. On Windows machines, it's in the registry. Here's how you do it:
http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx
Otherwise, whatever your compiler migth be (gcc, tcc, cpp) will not be found.

Using the lcc-win compiler from the command line

I have installed the lcc compiler so that I can compile c programs on my windows machine - but I am having troubles getting it to work...
I added C:\lcc\bin to my PATH environment variable, but when I type in:
lcc args
into my command line, I get this message: 'lcc is not recognized as an internal or external command, operable program or batch file'.
If I actually navigate to the folder C:\lcc\bin, I can execute lcc no problem
Is there something else I have to do other than set the PATH variable?
thanks!
I had also problems using lcc. By accident I started the editor that was also included in the package. Since then it works. I notice that I have to perform this operation each time I install it on a new computer. I suppose that it has to do with some initialization files that are required, but only created by the editor. Maybe this will also helps you.

Resources