I am trying to prepare a usb drive for use at school. I'll be compiling and running school work. I downloaded a portable version of Sublime Text https://www.sublimetext.com/download
and the standalone version of GCC https://winlibs.com/
Now, this is my setting for compiling on g++ on my linux and windows laptops. However, when I try to compile on my usb stick sublimetext, it says "gcc" is not in the path. I do have the standalone version of mingw on the same usb stick. Is it possible to point the g++ in my compile setting to the gcc on my usbstick?
Thanks!
{
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\""
}
]
}
I used to have such problems, theses are some possible turnarounds:
Put the MiNGW, or any other compiler, inside
the sublime text directory so you can access the
g++ relatively as: MiNGW/bin/g++
Create a cmd.exe instance and add gcc to path before running sublime text (you could create a special bat file for that)
In the worst case, you will need to enter the full path to gcc, or g++ and edit it as required.