Run MinGW gcc compiler on Windows 7 without setting environment variables

I have a MinGW folder on Windows, and I have not set any paths in the environment variables. When I run the following command:

D:\toolchains\MinGW\bin>gcc.exe hw.c -o hw

I got this error:

gcc.exe: error: CreateProcess: No such file or directory

As far as I understand, this problem is caused by the fact that I did not add this path to the environment variables. How can I solve this problem without adding this path to environment variables, because I plan to run this command with a Python script.

+4
source share
2 answers

You either need to change the PATH environment variable or start the gcc process using the appropriate working directory. You can do both in python:

PATH.

+3

PATH Mingw. . this, " ":

  • " " "".
  • "", " ".
  • . . PATH . , PATH. - , !
  • PATH , ""
  • ;<installation-directory>\bin

  • OK → OK → , .

, IDE, Codeblocks, . . , Mingw , Codeblocks. , Mingw, .. ..

+1

Source: https://habr.com/ru/post/1654556/


All Articles