Sublime Forum

'g++' is not recognized as an internal or external command, operable program or batch file

#1

THIS POST MAY BE IGNORED. RESTATING SUBLIME SOLVED IT

Hi,

I’m having problems when I try to compile programs in c++. I currently have this build file, which I stole of the internet somewhere, and it worked just fine.

{ 
	"cmd": ["g++", "$file", "-o", "$file_base_name"], 
	"selector": "source.c++", 
	"working_dir": "$file_path", 

	"variants": 
	[ 
		{ 
			"name": "Run", 
			"cmd": ["g++", "$file", "-o", "$file_base_name", "&&", "$file_path/$file_base_name"], 
			"shell": true 
		} 
	]
}

However, afterwards, I tried to install SDL onto my computer using the tutorial here
http://lazyfoo.net/SDL_tutorials/lesson01/windows/mingw/index.php

It didn’t work, so I deleted the related SDL files just in case, and also reverted the build file to what you see above.

However, now, when I run it, I get the following error:
g++' is not recognized as an internal or external command,operable program or batch file.

And before you say that it’s something to do with the path, I have properly configured it. (Again, this build has worked before). When I run g++ --version in the cmd prompt, I get the message:
g++ (GCC) 4.8.1 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; se the source for copying conditions. There is NO warranty...
Which I think means that it has found the correct path.

As I have very little computing knowledge, may I ask that all steps be spelled out in painstaking detail?

Thank you very much.

1 Like

#2

Ok, ignore this entire post.

For some reason, restarting sublime fixes this.

Sorry for wasting your time.

0 Likes

#3

Just wasted 20 mins trying to figure out what was wrong and found this lol

0 Likes