Solve the problem of opening gnome-tterminal error after sublime Text 3 installed Chinese input support library in Ubuntu (Linux) platform

Source: Internet
Author: User
Tags gtk sublime text



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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.