一只可爱的北斋厨的随笔 - 课程实验
1、https://www.cnblogs.com/biehongli/p/11183504.html根据这个安装好virtual BOX-虚拟机软件 。2、导入别人制作好的.ova文件ubuntu虚拟机OVA文件：https://ws28.cn/f/3oits2ftwfi虚拟机密码12343、导入.ova文件：https://jingyan.baidu.com/article/870c6fc3551e21b03fe4be14.html4、Linux常见命令：https://www.linuxcool.com/5、Makefilehttp://c.biancheng.net/makefile/6、由于是自己安装的，忘了安装gcc命令 make命令。在控制台（terminal）输入sudo apt-get install gcc sudo apt-get install make有时间学一下万能的apt包管理器，软件安装就是一行命令的事情。7、倘若用virtual box打开该.voa文件失败，建议安装另外一款虚拟机软件——Vmware WorkStation，打开方式改为此软件。8、如果打开后发现上不了网，请检查虚拟机的网卡设置，改为桥接模式或者是NAT。8.1experiment.zip9、实现细节，（命令）test@test-VirtualBox:~/Desktop$ mkdir experiment test@test-VirtualBox:~/Desktop$ cd experiment/ test@test-VirtualBox:~/Desktop/experiment$ mkdir test test@test-VirtualBox:~/Desktop/experiment$ cd test test@test-VirtualBox:~/Desktop/experiment/test$ mkdir calc test@test-VirtualBox:~/Desktop/experiment/test$ cd calc test@test-VirtualBox:~/Desktop/experiment/test/calc$ touch add.c test@test-VirtualBox:~/Desktop/experiment/test/calc$ touch main.c test@test-VirtualBox:~/Desktop/experiment/test/calc$ touch sub.c test@test-VirtualBox:~/Desktop/experiment/test/calc$ cd.. cd..: command not found test@test-VirtualBox:~/Desktop/experiment/test/calc$ cd .. test@test-VirtualBox:~/Desktop/experiment/test$ mkdir obj test@test-VirtualBox:~/Desktop/experiment/test$ mkdir elf test@test-VirtualBox:~/Desktop/experiment/test$ ls calc elf obj test@test-VirtualBox:~/Desktop/experiment/test$ touch Makefile test@test-VirtualBox:~/Desktop/experiment/test$ ll total 24 drwxrwxr-x 5 test test 4096 10月 9 21:53 ./ drwxrwxr-x 3 test test 4096 10月 9 21:48 ../ drwxrwxr-x 2 test test 4096 10月 9 21:53 calc/ drwxrwxr-x 2 test test 4096 10月 9 21:52 elf/ -rw-rw-r-- 1 test test 658 10月 9 21:53 Makefile drwxrwxr-x 2 test test 4096 10月 9 21:51 obj/ test@test-VirtualBox:~/Desktop/experiment/test$ make gcc -E ./calc/main.c -o ./obj/main.i gcc -S ./obj/main.i -o ./obj/main.s gcc -c ./obj/main.s -o ./obj/main.o gcc -E ./calc/add.c -o ./obj/add.i gcc -S ./obj/add.i -o ./obj/add.s gcc -c ./obj/add.s -o ./obj/add.o gcc -E ./calc/sub.c -o ./obj/sub.i gcc -S ./obj/sub.i -o ./obj/sub.s gcc -c ./obj/sub.s -o ./obj/sub.o gcc ./obj/add.o ./obj/sub.o ./obj/main.o -o ./elf/main test@test-VirtualBox:~/Desktop/experiment/test$ ./elf/main 16 4 test@test-VirtualBox:~/Desktop/experiment/test$ cd .. test@test-VirtualBox:~/Desktop/experiment$ ls test test@test-VirtualBox:~/Desktop/experiment$ tar -zcvf test.tar.gz test test/ test/Makefile test/calc/ test/calc/add.c test/calc/main.c test/calc/sub.c test/elf/ test/elf/main test/obj/ test/obj/add.s test/obj/main.o test/obj/sub.i test/obj/main.s test/obj/main.i test/obj/sub.o test/obj/sub.s test/obj/add.i test/obj/add.o test@test-VirtualBox:~/Desktop/experiment$ ls test test.tar.gz