Sublime Forum

Mystical [Error 2]

#1

Hello! I wanna compile a C++ program on ST2, but i always take next message:

[Error 2] [cmd: [u'g++', u'C:\\Users\\ChosenOne\\AppData\\Roaming\\Sublime Text 2\\Packages\\C++\\C++.sublime-build', u'-o', u'C:\\Users\\ChosenOne\\AppData\\Roaming\\Sublime Text 2\\Packages\\C++/C++']] [dir: C:\Users\ChosenOne\AppData\Roaming\Sublime Text 2\Packages\C++] [path: E:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TFSBuild.exe] [Finished]

It’s my program:

[code]#include <stdio.h>

int main (int argc, char* argv]) {
printf(“hello world\n”);
return 0;
}[/code]

and C++ builder:

[code]{
“cmd”: “g++”, “${file}”, “-o”, “${file_path}/${file_base_name}”],
“path”: “E:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\TFSBuild.exe”,
“file_regex”: “^(…^:]):([0-9]+):?([0-9]+)?:? (.)$”,
“working_dir”: “${file_path}”,
“selector”: “source.c, source.c++”,
“encoding”: “cp866”,

"variants":

	{
		"name": "Run",
		"cmd": "bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
	}
]

}
[/code]

What’s wrong?

0 Likes

#2

The “path” setting either shouldn’t be there, or should be pointing to the directory containing g++.exe.

0 Likes

#3

I’ve changed build like this:

[code]{
“cmd”: “g++”, “${file}”, “-o”, “${file_path}/${file_base_name}”],

"file_regex": "^(..^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"encoding": "cp866",

"variants":

	{
		"name": "Run",
		"cmd": "bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
	}
]

}
[/code]
and got next error message:

[Error 2] [cmd: [u'g++', u'E:\\Sublime Text 2\\hello.cpp', u'-o', u'E:\\Sublime Text 2/hello']] [dir: E:\Sublime Text 2] [path: E:\╤++\Inprise\vbroker\bin;E:\PROGRA~1\C__~1\Borland\CBUILD~1\Bin;E:\PROGRA~1\C__~1\Borland\CBUILD~1\Projects\Bpl;E:\Inprise\vbroker\bin;E:\Program Files\Borland\Delphi7\Bin;E:\Program Files\Borland\Delphi7\Projects\Bpl\;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\] [Finished]

0 Likes