-
Notifications
You must be signed in to change notification settings - Fork 189
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
可能的头文件冲突问题 #40
Comments
我们需要做什么以规避可能会出现的头文件冲突问题? 答: |
的的确确, 如果熟悉就不会出现这种header冲突 |
非常赞 解决了我的疑惑和唯一的顾虑 |
还有一个办法,比如我使用了spdlog库,为了避免冲突,先引入spdlog的头文件,再引入asio2,如下: target_include_directories(${PROJECT_NAME} PRIVATE
"${CMAKE_SOURCE_DIR}/lib/spdlog/include"
"${CMAKE_SOURCE_DIR}/lib/asio2/include"
"${CMAKE_SOURCE_DIR}/lib/asio2/3rd"
) |
还有一个办法,用xmake,里面的包已经处理好了,不存在冲突的问题 |
假设, 我有一个项目, 其同样需要使用fmt, spdlog, json等库, 且这些库的版本比当前所使用的版本更新.
那么我们需要做什么以规避可能会出现的头文件冲突问题?
有这个疑问是因为我看include/external/json里面是直接用了那个single header, 但假设我所在的项目也有这个single header, 那么是否会直接出现编译错误?
The text was updated successfully, but these errors were encountered: