首页 技术 正文
技术 2022年11月19日
0 收藏 842 点赞 3,300 浏览 1359 个字

在Ubuntu下安装Sublim Text3后发现无法输入中文,按照此链接的方法解决后。然后用下列代码配置C++的编译系统:

{
     "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.'"]
}
]
}

在配置完C++开发环境后编译发现报错。

错误如下:

(gnome-terminal:22242): Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is 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]

由于我们安装的支持中文的库使用的是GTK2.0的图形库,而gnome-terminal使用的是GTK3.0的库

在尝试将支持中文的库编译为基于GTK3.0的程序后再打开sublime程序直接崩溃。。

不得已,只能使用xterm代替gnome-terminal。将C++编译系统代码改为

{
"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","文泉驿等宽微米黑","-e","g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}' ; read -n1 -p 'press any key to continue.'"]  
}
]
}

成功!

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,082
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,557
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,406
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,179
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,815
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898