|gcampton you are great at explaining things,with patience.very few out there.so after that path it means that i can run everything that is in that folder?..and in the folder what i must have: the .txt file or the cpp with the source code?..and after that i open command prompt (start/run cmd) and what do i need to write so i can run it?..i see some interesting things "wtf" wrote above..and it may work but writing code in the console,and many instructions on a single line,i don't think is not the best way to go.so i stick with notepad..if i can make the damn thing to work :)|
(i now there are too many questions in so few lines,but i am at lvl 0)
Yes it means you can run/use EXECUTABLES (binary files, dll's, etc)
included in the PATH that you give to MS Windows, Environment Variables.
So lets say (This is an example don't actually do it), you delete everything in PATH, and you then create a folder on your desktop named "Files" and in that you put some exe's that you have made: eg, "Notepad.exe", "Paint.exe" and "Mihays_UnZipp.exe".
If you go and place the directory path in the environment variables PATH.
Then from the command line, if you type:
Notepad will start up.
Now obviously you want the folder of the compiler's path in the PATH variable. So that way you can use the compiler in command prompt. so if you copy the folder path for the MingW compiler into the PATH variable everything should be fine.
Now you don't have to do this for your .cpp and exe files because what you do is simply "change directory" within command prompt to go to those files.
The same can be done for above, if you didnt put the compiler in the PATH, then you could also just change directory to the compiler and use it from there.
OK, Now what do I mean about changing directory? Really you should look up a tutorial on how to use command prompt, simple and common used commands.
But it goes like this, The command prompt does not see the whole system, it only see's the current folder it is in, and it's environment variables:
this will change current directory to C drive.
will change the current directory to the binary directory for your compiler.
It's best to stick that directory in PATH though, because this then means you can use the compiler from any folder.
Lets say we have done that, now lets say you have some .cpp files you have created and saved in My Documents.
From command prompt you want to change to that directory, so::
This should and I say should lightly, as it has been many many years since I've used command prompt. This should change to your documents, and from here now you can compile your programs.
Will turn that into an executable named a.exe if it contains a main method, any other files you compile in the same fashion will override a.exe.
to see the list of commands you can use with GNU you will need to read the manual, unfortunately this cannot be done within the CMD prompt, unless you took my advice and installed the unix tools (cygwin).
So you will need to google/ goto the website.
to name your program:
g++ myFile.cpp -o NotePad.exe
will change the executable name to NotePad when it compiles.
-c creates object files only.
-Wall, -ANSI -pedantic give maximum amount of warnings.
But you can look all this up yourself.
PS If you do decide to install cygwin, read how to do the full install it's about 7gb, normal version is about 1.2gb. Then search for unix terminal eBooks, linux help eBooks, etc.
"How to use Linux terminal".
(It's not called command prompt in linux)