需求:32位安全计算机跑对应的程序
来源:全部是网络
Linux的安装
虚拟机:VMare 16(虚拟机跑的是12的核)
Linux 版本 14.04.06
.04好像都是32位的,目前官网接近绝迹,曾经用16.04.06,安装完Qt有莫名奇妙的错误无法解决
Linux的安装按部就班,网上资源丰富,要注意设置高级自定义安装,同时断网,据我所知16.04的版本竟然是在官网上又下载了东西
Qt的安装
版本名字:qt-linux-opensource-5.0.0-x86-offline.run
目前也是接近于绝迹, x86 means 32位
方法:cd 源目录,sudo chmod -R 777 qt.....,
sudo ./qt....开始安装
安装完成后运行,可能会出现 Permission denied的报错,建议先重启,如果还是不行,需要chmod改权限,我当初改的已经找不到了,不过权限不能随便改,像include lib这些改了以后系统就很容易崩了
Qt环境的配置
首先,设置镜像源,否则下载速度奇慢无比。但是网上敲代码的还没有搞太懂,采用以下方式
系统设置-软件和更新-源代码
然后,安包包
sudo apt-get install g++ sudo apt-get install libgl1-mesa-dev libglu1-mesa-de
接下来对这句话进行“翻译”
apt-get 家族
sudo apt-get install XXXsudo apt-get install -y XXXsudo apt-get install -q XXXsudo apt-get remove XXXsudo apt-get purge XXXsudo apt-get autoremovesudo apt-get updatesudo apt-get upgrade
记得一开始忘记敲install,报错....
打开/etc/apt/source.list
cat /etc/apt/sources.list deb http://security.ubuntu.com/ubuntu trusty-security main restricteddeb-src http://security.ubuntu.com/ubuntu trusty-security main restricteddeb http://security.ubuntu.com/ubuntu trusty-security universedeb-src http://security.ubuntu.com/ubuntu trusty-security universedeb http://security.ubuntu.com/ubuntu trusty-security multiversedeb-src http://security.ubuntu.com/ubuntu trusty-security multiversedeb http://extras.ubuntu.com/ubuntu trusty maindeb-src http://extras.ubuntu.com/ubuntu trusty maindeb http://us.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted multiverse universe
安装软件
Reading package lists... DoneBuilding dependency tree Reading state information... DoneThe following packages were automatically installed and are no longer required:account-plugin-windows-live libblas3 libbonobo2-0 libbonobo2-commonlibbonoboui2-common libglade2-0 libgnomecanvas2-0 libgnomecanvas2-commonlibgnomeui-common libidl-common libidl0 libisl10 liblinear-tools liblinear1libllvm3.5 libntdb1 liborbit-2-0 liborbit2 libupstart1linux-headers-3.16.0-30 linux-headers-3.16.0-30-genericlinux-image-3.16.0-30-generic linux-image-extra-3.16.0-30-genericUse 'apt-get autoremove' to remove them.The following extra packages will be installed:libdiodon0 libunique-3.0-0Suggested packages:diodon-pluginsThe following NEW packages will be installed:diodon libdiodon0 libunique-3.0-00 upgraded, 3 newly installed, 0 to remove and 221 not upgraded.Need to get 272 kB of archives.After this operation, 1,348 kB of additional disk space will be used.Do you want to continue? [Y/n]
先是reading,在网站列表里面查,然后就是查相互依赖的包 ,安装
g++
搞懂这个得先默认搞懂IDE和编译,g++是真正编译C++的东西,把他编译成2进制的机器能懂的,之前的VS就是内置了编译系统。
另外gcc对应c,这两个linux系统用的多,win系统一般是msvc, mac是clang
一点疑惑
libgl1-mesa-dev libglu1-mesa-de
关于这两个文件,说实话我也不懂,网上资源廖廖,如果有高人的希望指点一二。
最后在Qt程序里面添加上这个编译器就好了!万事大吉,成功不报错跑项目,然而,这只是个开始……