gpt4 book ai didi

c++ - 将 Windows C++ 项目从 Qt4 移动到 5 会出现数百个看似无关的编译错误

转载 作者:行者123 更新时间:2023-12-01 14:38:06 25 4
gpt4 key购买 nike

<分区>

我升级到 Qt5/msvc2010,现在正尝试使用 Qt Creator 构建一个项目,该项目在 Qt4/msvc2008 上运行良好(自运行以来没有更改源代码)。

该项目使用一些 COM 元素通过 Olympus SDK 与外部录音设备对话。

当我升级到 Qt5 之前一切正常时,是什么导致了所有这些错误?据我所知,这些错误中列出的类都没有被我的项目实际使用。

我已经尝试在每个可能的头文件中包含定义相关类的文件(例如 ocidl.h for IEnumConnections),甚至将包含的顺序切换为许多不同的组合也无济于事。

e:\bp\mainwindow.h(21) : warning C4005: 'WINVER' : macro redefinition
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\sdkddkver.h(212) : see previous definition of 'WINVER'
e:\bp\mainwindow.h(25) : warning C4005: '_WIN32_WINNT' : macro redefinition
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\sdkddkver.h(197) : see previous definition of '_WIN32_WINNT'
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(53) : error C2146: syntax error : missing ';' before identifier 'IEnumConnections'
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(53) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(53) : error C2146: syntax error : missing ';' before identifier 'IEnumConnections'
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(53) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(53) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(53) : error C2086: 'int IEnumConnections' : redefinition
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(53) : see declaration of 'IEnumConnections'
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(59) : error C2146: syntax error : missing ';' before identifier 'IConnectionPoint'
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(59) : warning C4091: '' : ignored on left of 'interface' when no variable is declared
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(65) : error C2146: syntax error : missing ';' before identifier 'IEnumConnectionPoints'
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(65) : warning C4091: '' : ignored on left of 'interface' when no variable is declared
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(71) : error C2146: syntax error : missing ';' before identifier 'IConnectionPointContainer'
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(71) : warning C4091: '' : ignored on left of 'interface' when no variable is declared
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(77) : error C2146: syntax error : missing ';' before identifier 'IClassFactory2'
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(77) : warning C4091: '' : ignored on left of 'interface' when no variable is declared
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(83) : error C2146: syntax error : missing ';' before identifier 'IProvideClassInfo'
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(83) : warning C4091: '' : ignored on left of 'interface' when no variable is declared
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(89) : error C2146: syntax error : missing ';' before identifier 'IProvideClassInfo2'
C:\Program Files\Microsoft SDKs\Windows\v7.0\Include\ocidl.h(89) : warning C4091: '' : ignored on left of 'interface' when no variable is declared

完整的错误列表在这里:http://dpaste.com/1525608/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com