g++/git/vim相关学习笔记
2023-12-16 05:06:43
multirotor
The first day ——12.10
-
install vmware-workstation and ubuntu
-
swap sources and 换输入法
-
learn git
-
github关联远程仓库
-
install and use Typora
Git
| code | meaning |
|---|---|
| mkdir test | 创建目录 |
| cd test | 进入目录 |
| git init | 初始化仓库 |
| ls ;ls -ah | 查看目录 |
| touch test.c | 新建项目 |
| add | 添加到缓存 |
| commit -m “words” | 提交到库 |
| log | 提交历史 |
| status | 查看仓库状态 |
| checkout – file | 回到最近修改状态 |
| rm ;rm -rf file | 删除 |
| reset+checkout | 恢复文件 |
| checkout -b dev | 创建分支+切换 |
| merge | 合并 |
| branch -a | 查看分支 |
| branch -D | 删除分支 |
| branch -m | 修改分支名 |
| clone | 远程仓库关联到本地 |
| push origin branch | 修改提交 |
The second day——12.11
1. install and learn g++
- question1: unable to install g++
- sovle1:swap sources;
2. c++ printf “hello world”
-
question2:unable to edit helloworld.cpp
-
sovle2:learn vim
-
question3:unable to compile and run
-
sovle3:learn g++ about linking cpp files
G++
some command:
| command | meaning |
|---|---|
| -o outputfile file.cpp | 编译为可执行文件 |
| -c | 编译为对象文件 |
| -o outputfile file1.o file2.o | 链接对象文件 |
about .o files and .exe files:
对象文件和可执行文件的主要区别在于链接的程度:对象文件包含了部分链接的代码,而可执行文件包含了完全链接的代码。在一些大型项目中,源代码可能被分割成多个文件,然后分别编译成对象文件,最后再链接成一个可执行文件。这样的做法可以提高编译的效率,因为当某个源文件被修改时,只需要重新编译那个文件,而不需要重新编译整个项目。
g++ -o test1 hello.cpp helloworld.cpp
g++ -c hello.cpp
g++ -c helloworld.cpp
g++ -o test2 hello.o helloworld.o
g++ -o test3 hello.o helloworld.cpp
g++ -o test4 hello.cpp //wrong
vim
默认命令模式
| command | meaning |
|---|---|
| ESC | 命令模式 |
| gg / G/ 5+G | 首行/末行/第五行 |
| yy / p/ dd | 复制/粘贴/剪切 |
| u / ctrl + r | 撤销/取消撤销 |
| +i / +a | 编辑模式 |
| :/ wq/ q! | 末行模式/保存退出/强制退出 |
文章来源:https://blog.csdn.net/Star__01/article/details/134938988
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!