Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
这条命令创建了一个名为 stbiw 的静态库。
STATIC 表示这是一个静态库。
stb_image_write.cpp 是这个库的源文件。
target_include_directories(stbiw PUBLIC .):
这条命令为目标 stbiw 设置了头文件搜索路径。
PUBLIC 表示这个路径不仅在编译 stbiw 时使用,还会在编译任何依赖 stbiw 的目标时使用。 . 表示当前目录。
stb设计为头文件库,设计的初衷就是通过一个头文件提供所有功能。通过这种方式,可以简化库的使用和集成。这样,stb_image_write 库的所有函数就会在这个 .cpp 文件中实现,而在其他文件中只需要包含 stb_image_write.h 即可使用这些函数。
pragma once使程序编译只包含一次,可以加快编译速度