After installing Sublim Text3 under Ubuntu, I found that I could not enter Chinese, following the method of this link. Then use the following code to configure the C + + compiler system:
{
"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":["gnome-terminal","-x","bash","-c","g++ ‘${file}‘ -o ‘${file_path}/${file_base_name}‘ && ‘${file_path}/${file_base_name}‘ ; re ad -n1 -p ‘press any key to continue.‘"]
}
]
}
Compilation found an error after configuring the C + + development environment.
The error is as follows:
(gnome-terminal:22242): Gtk-error * *: GTK + 2.x symbols detected. Using GTK + 2.x and GTK + 3 in the same process are not supported
[Finished in 0.2s with exit Code-5]
[cmd: [' gnome-terminal ', '-X ', ' Bash ', '-C ', ' g++ '/root/code/test.cpp '-o '/root/code/test ' && '/root/code/test ‘ ; Read-n1-p ' Press any key to continue. ']
[dir:/root/code]
[Path:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games]
because the Chinese-enabled libraries we installed use the GTK2.0 graphics library, Gnome-terminal uses the GTK3.0 library
The sublime program crashes directly after you try to compile a library that supports Chinese into a GTK3.0-based program.
Last resort, only use xterm instead of gnome-terminal. Change the C + + compiled system code to
{
"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": ["xterm", "Fa", "WenQuanYi equal width micron black", "e", "G + + '${file}' - o '${file} / ${file {base}' & & '${file} / ${file {base}'; read - N1 - p 'press any key to continue.'"
}
]
}
Success!
Solve the problem of opening gnome-tterminal error after sublime Text 3 installed Chinese input support library in Ubuntu (Linux) platform