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.
遇到重定义问题,知道是头文件重复引入的问题。应该只引入一次即可,但是cmake没有这个编译参数,又不能更改main函数,只能在子模块里改,cpp文件内放入一个宏和include头文件,main函数调用不同头文件,头文件有pragma once,所以只会引入一次lib库文件。mandel和rainbow合并成一个文件就可以避免出现这种情况,
开始困扰我的地方在于我一直以为是只能改cmakelists.txt,但是cmake里面没有课件上写的target_add_definitions函数,最后也是看答案了(😔,结果发现就差一步,太难受了。