Sublime Forum

Build file error

#1

I used this build file in windows 10 64bit

{
“cmd”: [“g++”, “-std=c++11”, “${file}”, “-o”, “${file_path}/a.out”],
“file_regex”: “^(…[^:]):([0-9]+):?([0-9]+)?:? (.)$”,
“working_dir”: “${file_path}”,
“selector”: “source.c, source.cpp, source.c++”,

"variants":
[
	{
		"name": "Run",
		"cmd": [ "${packages}/Competitive Programming/run.sh", "c++11", "${file_path}", "a.out"]
	}
],

"windows":
{

	"variants":
	[
		{
			"name": "Run",
			"cmd": ["${packages}\\\\Competitive Programming\\\\run.bat", "c++11", "${file_path}", "a.out"]
		}
	]
}

}

but running with the build is showing this error.

[WinError 193] %1 is not a valid Win32 application
[cmd: [‘C:\Users\Lenovo\AppData\Roaming\Sublime Text\Packages/Competitive Programming/run.sh’, ‘c++11’, ‘D:\programming\inputting n as well as inputting m(m is 2 digit)’, ‘a.out’]]
[dir: D:\programming\inputting n as well as inputting m(m is 2 digit)]
[path: C:\MinGW\bin;C:\Windows\System32;C:\MinGW\bin;C:\Users\Lenovo\AppData\Local\atom\bin]
[Finished]

0 Likes

#2

[WinError 193] %1 is not a valid Win32 application

is usually an indicator of a messed up environment. Try checking if your PATH environment variable is set properly.

0 Likes

#3

yes this is created properly with mingwbin

0 Likes

#4

A command specified by cmd is invoked directly, which fails as it is no valid executable. You may want to try shell_cmd instead. It may also be required to explicitly specify the sh or bash interpreter as executable on Windows boxes.

0 Likes