Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

作业01 #111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

作业01 #111

wants to merge 1 commit into from

Conversation

M-Cyclone
Copy link

2023-01-31
-创建stb_image_write.cpp,并在CMakeLists.txt中创建stbiw库,包含cpp和h文件
-target_include_directories引入h文件的路径,保证main所在的项目可以让CMake通过链接stbiw时找到对应头文件
-stbiw是C风格库,前一半为函数声明,后一半为函数定义,其中函数定义被宏STB_IMAGE_WRITE_IMPLEMENTATION包含起来,当且仅当此宏被定义是,编译器才读取定义并给出编译结果,否则相当于仅仅读取一个包含了一系列函数声明的头文件,从而实现在一个给定区域通过STB_IMAGE_WRITE_IMPLEMENTATION定义函数,其他地方仅引入头文件用于编译通过的目的

-创建stb_image_write.cpp,并在CMakeLists.txt中创建stbiw库,包含cpp和h文件
-target_include_directories引入h文件的路径,保证main所在的项目可以让CMake通过链接stbiw时找到对应头文件
-stbiw是C风格库,前一半为函数声明,后一半为函数定义,其中函数定义被宏STB_IMAGE_WRITE_IMPLEMENTATION包含起来,当且仅当此宏被定义是,编译器才读取定义并给出编译结果,否则相当于仅仅读取一个包含了一系列函数声明的头文件,从而实现在一个给定区域通过STB_IMAGE_WRITE_IMPLEMENTATION定义函数,其他地方仅引入头文件用于编译通过的目的
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant