0

I want to be able to save my files in E:\Documents\C++ and then be able to run and compile them. My MinGW location is E:\MinGW\bin. Everything is saved on a USB flash drive. I am using SublimeText to run and compile these files. Everything works fine if i save the C++ files in the E:\MinGW\bin folder. I just want to be able to change where to save the files and build and run them. Also I am using this as my sublime-build file

{
    "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",
            "cmd": ["${file_path}/${file_base_name}.exe"]
        }
    ]
}
Daniel
  • 4,202
  • 11
  • 50
  • 68

2 Answers2

0

Your path should contain E:\MinGW\bin (or you should give full path for g++)

Jarod42
  • 203,559
  • 14
  • 181
  • 302
0

You want to change your home directory and your path for mingw.

This page shows how to set your home directory, and where to set your PATH, http://www.mingw.org/wiki/HOWTO_Set_the_HOME_variable_for_cmd_exe

Here is a page that tells you how to build a cpp file, http://www.mingw.org/wiki/MinGW_for_First_Time_Users_HOWTO

If you want to use the same home location for MINGW and windows, http://mingw.5.n7.nabble.com/making-home-directory-on-msys-agree-with-Windows-td22176.html

Or, you can set your home directory to your flash drive.

ChuckCottrill
  • 4,360
  • 2
  • 24
  • 42