将Windows程序移植到Linux环境中(2)
搭建开发环境
在CentOS7.2上安装集成开发环境作为开发环境。
评估对象如下。
-
- Visual Studio Code
- Eclipse
暂时尝试使用Visual Studio Code,并在遇到问题时再考虑使用Eclipse。
获取Visual Studio Code的方法
从微软公司的网页上下载rpm文件。
https://code.visualstudio.com/download
这次下载的文件是「code-1.20.1-1518536126.el7.x86_64.rpm」。
以下是Visual Studio Code的安装指南。
使用 yum 命令进行安装。
yum install code-1.20.1-1518536126.el7.x86_64.rpm
如果libXss.so.1的安装失败,请检查以下yum设置。
yum的配置 (Yum’s configuration)
你连接上了互联网吗?
代理服务器的设置
在最后一行添加以下内容。
proxy=http://proxy.xxx.xxx:pp
设置仓库
在RHEL环境下,如果要使用CentOS的软件源,需要创建以下文件。
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
启动Visual Studio Code
安装后,[编程] – [Visual Studio Code] 会被注册在应用程序菜单中。
或者可以在控制台输入 “code .” 来启动。