From 4183a922e74539e5efef7fb1b7f1ef09a5f91b28 Mon Sep 17 00:00:00 2001 From: FangcatChina Date: Thu, 13 Aug 2026 13:32:52 +0800 Subject: fix: remove unnecessary development guide --- docs/applications/programming/cpp.md | 60 ------------------------------------ 1 file changed, 60 deletions(-) (limited to 'docs') diff --git a/docs/applications/programming/cpp.md b/docs/applications/programming/cpp.md index e5d01b7..22b0b0f 100644 --- a/docs/applications/programming/cpp.md +++ b/docs/applications/programming/cpp.md @@ -103,65 +103,5 @@ g++ hello.cpp -o hello 这个时候终端会打印 hello world, 恭喜你成功用命令行成功编写并运行了一个C++程序。 -## 多文件编译 - -当我们的源文件不止一个的时候, 我们需要在编译的时候把所有用到的源文件都写上(当然仅限于自己写的那些源文件,标准库就不需要了)。 - -比如说这个项目: - -```bash -❯ tree -. -├── CMakeLists.txt -├── compile_commands.json -├── include -│   ├── legacy -│   │   ├── CommentIO.hpp -│   │   ├── Filter.hpp -│   │   ├── LegacyFilterPipeline.hpp -│   │   └── NaiveScanner.hpp -│   ├── lib -│   │   ├── csv.hpp -│   │   └── simdutf.h -│   └── localLib -│   ├── BloomDeduplicator.hpp -│   ├── Comment.hpp -│   ├── CommentInteractiveInput.hpp -│   ├── CsvCommentInput.hpp -│   ├── CsvUtil.hpp -│   ├── Deduplicator.hpp -│   ├── FilterPipeline.hpp -│   ├── HammingDeduplicator.hpp -│   ├── ICommentSource.hpp -│   ├── Matrix.hpp -│   ├── mini_test.h -│   ├── PathUtil.hpp -│   ├── Recorder.hpp -│   ├── SlidingWindowLimiter.hpp -│   ├── Trie.hpp -│   ├── WatchMode.hpp -│   ├── WordAppender.hpp -│   ├── WordLibarary.hpp -│   └── WorkPerformaceAnalyser.hpp -├── makefile -├── src -│   ├── main.cpp -│   └── simdutf.cpp -``` - -不要看有这么多文件, 但是这个明显是一个 header only 的项目, 只有 src/ 目录里面有两个cpp 文件,所以我们只需要编译的时候指定这两个即可。 - -```bash -# 创建一个 bin 目录放产物 如果你还没有的话 -mkdir -p bin - -g++ src/simdutf.cpp src/main.cpp -o bin/main -# 当然我们有更好的策略, 我们使用的可是高贵的Linux -# g++ src/* -o bin/main -# 直接使用通配符编译所有的cpp文件 -``` - -这里给个建议就是将cpp源文件和hpp头文件分开,这样方便管理。 - 现在你已经学会如何使用命令行编译cpp程序了,当然还有各种的编译方式,有各种编译工具,但是入门的话现在这些知识就够了。 祝贺你。 -- cgit v1.3