实验一 编程环境
1.在Linux中编写一个程序,在bash中输出“hello world”。
2.编写一个程序,输出该数据的平均值。
3.将2中求平均值的函数ave打包生成一个静态库和一个动态库,并在main.c中调用。
4.编写上述两个程序的Makefile文件,通过make命令进行编译。
VMware urbantu的安装
- https://www.vmware.com/cn.html 下载Workstation Pro
- https://ubuntu.com/download
linux部分功能安装
sudo apt-get update //更新软件包缓存
sudo apt-get install 软件包名 //安装
sudo apt-get autoremove 软件包名 //删除
安装gcc
sudo apt-get install build-essential
gcc --version //查看
安装vim
sudo apt-get install vim-gtk
安装tools
tar zxvf VMwareTools-10.3.10-13959562.tar.gz //解压
输出“hello world”
touch hello.c //创建一个文件
gedit hello.c //创建并打开一个文件
gcc -o hello hello.c //编译
建立静态库
main.c
#include<stdio.h>
#include"ave.h"
int main