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

不需要为 qt 特意使用 Debug 版本 静态库 #34

Merged
merged 2 commits into from
Oct 17, 2024
Merged

Conversation

microcai
Copy link
Member

反而会遇到

[build] Qt6Core.lib(qcoreevent.cpp.obj) : error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qcoreevent.cpp.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MT_StaticRelease”不匹配值“MTd_StaticDebug”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qdatastream.cpp.obj) : error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qdatastream.cpp.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MT_StaticRelease”不匹配值“MTd_StaticDebug”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qdeadlinetimer.cpp.obj) : error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qdeadlinetimer.cpp.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MT_StaticRelease”不匹配值“MTd_StaticDebug”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qstringlist.cpp.obj) : error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qstringlist.cpp.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MT_StaticRelease”不匹配值“MTd_StaticDebug”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qeventloop.cpp.obj) : error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qeventloop.cpp.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MT_StaticRelease”不匹配值“MTd_StaticDebug”

修正后,不管 Debug 还是 Release 都能正常编译通过。

反而会遇到

[build] Qt6Core.lib(qcoreevent.cpp.obj) : error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qcoreevent.cpp.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MT_StaticRelease”不匹配值“MTd_StaticDebug”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qdatastream.cpp.obj) : error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qdatastream.cpp.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MT_StaticRelease”不匹配值“MTd_StaticDebug”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qdeadlinetimer.cpp.obj) : error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qdeadlinetimer.cpp.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MT_StaticRelease”不匹配值“MTd_StaticDebug”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qstringlist.cpp.obj) : error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qstringlist.cpp.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MT_StaticRelease”不匹配值“MTd_StaticDebug”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qeventloop.cpp.obj) : error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”(testqt.cpp.obj 中)
[build] Qt6Core.lib(qeventloop.cpp.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MT_StaticRelease”不匹配值“MTd_StaticDebug”

修正后,不管 Debug 还是 Release 都能正常编译通过。
Copy link
Member

@EvinceMoi EvinceMoi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ci修改直接通过

@microcai microcai merged commit 7741959 into master Oct 17, 2024
12 checks passed
@microcai microcai deleted the fix-qt branch October 17, 2024 07:55
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.

2 participants