#Make not finding commands

40 messages · Page 1 of 1 (latest)

cobalt pelican
#

I've been trying to use makefiles on win for a while now, and it always doesn't work (that's why I'm using just)
even if just trying to make a simple sdl window, it doesn't like it, it always shows that similar error

btw, that message in the end means "system could not find given program" but I do have mkdir (even on cmd, I've clink with autoinject)

On just, I can just change the shell, but even then, it works with the default shell (aka cmd) as shown on the 2nd image

cinder socketBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

cobalt pelican
#
build: build-folders
    gcc -o ./bin/main -I./SDL3/include/ -L./SDL3/lib/ main.c -lSDL3
    cp ./SDL3/bin/SDL3.dll ./bin

build-folders:
    mkdir ./bin
```That's the whole makefile, btw
split heron
#

sounds like the path in your first shell doesn't have a directory that the path in your second shell does

a short explanation of what the $PATH environment variable is: most, if not all, shells ship with very few commands actually internal to the shell itself (otherwise known as "builtins" because they're built in to the shell). to run commands that are not builtins, the shell refers to the $PATH variable, which is a string containing paths to various directories, separated by a colon (:). on unix-like systems, the minimal $PATH is usually /bin:/usr/bin, before the user and various programs extend it. anytime the shell receives input, it first parses the line, then (usually) runs the first token as a command. if the command is not a builtin, it then searches through each directory in the $PATH, starting with the first, to find a match. if none is found, then and only then do you get something like a "command not found" error

sturdy condor
#

I know Make works in MSYS2. Maybe try that?

cobalt pelican
cobalt pelican
#

I like my memory, lol

sturdy condor
#

I don't say to keep using it (if you don't want to). At least you could compare your configuration with what they have

#

For starters, is it only mkdir that fails? Does gcc ... command work?

stable mesa
cobalt pelican
#

which doesn't work, since if make doesn't recognize it, neither should just

stable mesa
cobalt pelican
#

it's in the createprocess, there is no commands on the portuguese part

#

it's not finding mkdir, I think

stable mesa
#

aight, then I was wrong. Just checking though

split heron
cobalt pelican
#

so does make

split heron
cobalt pelican
#

I just fixed it now by adding the git stuff to path (which doesn't make much sense, but whatever)

split heron
#

yeah, i wish programming didn't rely on the environment as much as it does

cobalt pelican
#

btw, still makes no sense why the make command didn't work

#

since cmd has mkdir

split heron
#

try Get-Command mkdir -All. on unix-like systems this would be type -a mkdir, and my system specifically returns mkdir is /usr/bin/mkdir mkdir is /bin/mkdir mkdir is /usr/sbin/mkdir

cmd has mkdir
true, and so does bash (my shell), but it's not a builtin, it's a file (or "Application", in windows parlance). if i were to type export PATH='' in my terminal right now, any future attempts to run mkdir would fail with bash: mkdir: command not found

cobalt pelican
#

it is there, lol, it just doesn't want to work (2nd one is the alias I just made)

split heron
#

huh. well, the Get-Command doc page does say

Get-Command that uses the exact name of the command, without wildcard characters, automatically imports the module that contains the command so that you can use the command immediately.

sturdy condor
#

That's why I was suggesting MSYS2, it does too (in fact, git uses a tripped down msys2 I think)

cobalt pelican
#

both are from git, btw

#

everything from (...)\usr\bin was added recently

sturdy condor
#

What's why I recommend msys2. It brings everything with it: sh, make, mingw, prebuilt third-party libs. And everything is configured to interoperate correctly out of the box

cobalt pelican
#

everything on ~/scoop/shims/ is on path by default

cobalt pelican
cobalt pelican
#

!solved