I am using the gpp package and when i try to compile my code it gives me this error in the cmd, I’ve tried adding atom and system 32 to PATH but it still wont work. Thanks in advance to anyone who can help me.
'C:\Users\"USERNAME"' is not recognized as an internal or external command, operable program or batch file. The system cannot find the path specified
You could at least make the effort and post a link to the package you’re using. There are several gcc packages to choose from. The three packages I checked, all have mention in the package description that you need to install
gcc and add it to your
PATH. Did you do that? If not, there are plenty of guides, including on this very forum.
sorry, i am new to discussion boards.
i am using gpp-compiler by kriscross7.
I’ve already installed the mingw compiler and added it to my PATH, but i still get the same error.
I think ive found the problem, but i dont know who to fix it. My username has the symbol “&” in it. But when compiling, the program only goes up to the characters before the and and then stops, therefore it cant find the directory, does anyone know how to fix this?
Regardless of if you fix this issue or not, please never use special characters in a username for your own sake. Many programs (like that one) will break because the dev did not escape / “string” things properly. It’s not your fault they didn’t do it right, but it will save you a lot of headaches.
I dont want to reset my whole profile, is there any better way??
I meant in future, things can break if you don’t change it properly.
As for the way, the problem is bad string handling when the path has a special character. So you’d have to raise an issue on the package and hope it’s maintained, edit the source code yourself, or use a different package (I don’t have any suggestions).
This user had the same problem … https://discuss.atom.io/t/atom-hacktable-installation-problems/63129/20
gpp-compiler is a constant causer of problems and you shouldn’t use it.
process-palette will give you no errors and absolute control.
I’ve looked it up, but i cant seem to find any instructions for using process-palette to compile c++, could you help?
There’s nothing special about using
process-palette except that it doesn’t spawn a terminal natively, so if you want to interact with your program you’ll have to work that into the command string. For Windows, a command like this will do the trick:
sry if this is a dumb question, but what do i put in the (file name extension) and (fileDirAbsPath)?
You don’t put anything there.
process-palette fills them in at run time, so that you don’t have to enter the names of every individual file you want to run.
so, when i press f5 it opens up the cmd window for a split second and then goes away, im just running a simple hello world file. it does show any output anywhere?
If you included the
&& pause part, then it should give you a “Press Any Key…” prompt. You can use the
/k switch instead of
/c to open a window that will stay open after all programs terminate.
it works with the /k, but now im getting gpp is not recognised as an internal or external command
Sorry, I’m not a C person and I get the acronyms mixed up sometimes. Try
gcc, which is the name of the compiler software. If it doesn’t work, that means that you haven’t installed it. You should follow this tutorial to install MinGW on your system.
ok, sry for the constant problems, but now when i run it it doesnt output anything, it just says (Press any key to continue . . .) and then closes the window when i press a key
Mind posting a screenshot of your code file?