最近在使用github上的一个模拟器,需要自己对其中文件进行make编译。但是中间遇到了不知道多少个错误,吐血。想了想还是记录一下,
错误
compiling moc/moc_qwt_plot_panner.cpp
compiling moc/moc_qwt_plot_picker.cpp
compiling moc/moc_qwt_plot_zoomer.cpp
compiling moc/moc_qwt_slider.cpp
compiling moc/moc_qwt_scale_widget.cpp
{standard input}: Assembler messages:
{standard input}:4145: Warning: end of file in string; '"' inserted
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
Makefile:139809: recipe for target 'obj/qrc_qgcresources.o' failed
make[1]: *** [obj/qrc_qgcresources.o] Error 4
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/emma/ub-anc/build-emulator/qgc_gui'
Makefile:43: recipe for target 'sub-qgc_gui-make_first-ordered' failed
make: *** [sub-qgc_gui-make_first-ordered] Error 2
解决方法
google了各种办法,发现应该是内存不够,ubuntu的make命令好像比较吃内存。
- 尝试用swap
- check系统中swap的配置
- 查看多少可用的swap以及memory
$ sudo swapon --show
$ free -h
$ df -h
$ sudo fallocate -l 2G /swapfile
$ ls -lh /swapfile
$ sudo chmod 600 /swapfile
$ ls -lh /swapfile
$ sudo mkswap /swapfile
详情见下图:
到这里,然后再重新执行qmake与make命令,就成功啦。
Note1 : ** swap的开启以及更多相关命令请参考:**
How To Add Swap Space on Ubuntu 16.04
Note2:该编译错误参考链接:
luascript.cpp.o Warning: end of file in string Ubuntu 14.04x64 - SOLVED #1408
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)