本文共 293 字,大约阅读时间需要 1 分钟。
首先写一个可cpp文件,helloworld.cpp
然后编译它
g++ hellowrold.cpp -o hello
然后打包
tar -zcv -f ./hello.tar.gz ./hello
然后写一个install.sh
然后把install.sh和hello.tar.gz进行拼接,得到run文件
cat ./install./sh ./hello.tar.gz > myinstall.run
如果myinstall.run没有可执行权限,则添加权限
chmod +x ./myinstall.run
运行myinstall.run,则得到了我们的可执行文件啦
大功告成