Skip to content

fix: Missing includes when building with USE_PRECOMPILED_HEADERS=OFF - #5389

Merged
pajlada merged 1 commit into
Chatterino:masterfrom
brian6932:fix/missing-includes-pch-off
May 11, 2024
Merged

pajlada merged 1 commit into
Chatterino:masterfrom
brian6932:fix/missing-includes-pch-off

Conversation

@brian6932

Copy link
Copy Markdown
Contributor

Fixes the following build errors with -DUSE_PRECOMPILED_HEADERS=OFF on Windows.

TitlebarButtons.hpp
src\widgets/helper/TitlebarButtons.hpp(13): error C2504: 'QObject': base class undefined
src\widgets\helper\TitlebarButtons.cpp(16): error C2614: 'chatterino::TitleBarButtons': illegal member initialization: 'QObject' is not a base or member
AttachToConsole.cpp
src\util\AttachToConsole.cpp(16): error C2065: 'stdout': undeclared identifier
src\util\AttachToConsole.cpp(16): error C3861: 'freopen_s': identifier not found
src\util\AttachToConsole.cpp(16): error C2678: binary '=': no operator found which takes a left-hand operand of type 'const std::_Ignore' (or there is no acceptable conversion)
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\tuple(129): note: could be 'std::_Ignore &std::_Ignore::operator =(std::_Ignore &&)'
src\util\AttachToConsole.cpp(16): note: 'std::_Ignore &std::_Ignore::operator =(std::_Ignore &&)': cannot convert 'this' pointer from 'const std::_Ignore' to 'std::_Ignore &'
src\util\AttachToConsole.cpp(16): note: Conversion loses qualifiers
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\tuple(129): note: or       'std::_Ignore &std::_Ignore::operator =(const std::_Ignore &)'
src\util\AttachToConsole.cpp(16): note: 'std::_Ignore &std::_Ignore::operator =(const std::_Ignore &)': cannot convert 'this' pointer from 'const std::_Ignore' to 'std::_Ignore &'
src\util\AttachToConsole.cpp(16): note: Conversion loses qualifiers
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\tuple(125): note: or       'const std::_Ignore &std::_Ignore::operator =(const _Ty &) noexcept const'
src\util\AttachToConsole.cpp(16): note: Failed to specialize function template 'const std::_Ignore &std::_Ignore::operator =(const _Ty &) noexcept const'
src\util\AttachToConsole.cpp(16): note: With the following template arguments:
src\util\AttachToConsole.cpp(16): note: '_Ty=unknown-type'
src\util\AttachToConsole.cpp(16): note: while trying to match the argument list '(const std::_Ignore, unknown-type)'
src\util\AttachToConsole.cpp(17): error C2065: 'stderr': undeclared identifier
src\util\AttachToConsole.cpp(17): error C3861: 'freopen_s': identifier not found
src\util\AttachToConsole.cpp(17): error C2678: binary '=': no operator found which takes a left-hand operand of type 'const std::_Ignore' (or there is no acceptable conversion)
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\tuple(129): note: could be 'std::_Ignore &std::_Ignore::operator =(std::_Ignore &&)'
src\util\AttachToConsole.cpp(17): note: 'std::_Ignore &std::_Ignore::operator =(std::_Ignore &&)': cannot convert 'this' pointer from 'const std::_Ignore' to 'std::_Ignore &'
src\util\AttachToConsole.cpp(17): note: Conversion loses qualifiers
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\tuple(129): note: or       'std::_Ignore &std::_Ignore::operator =(const std::_Ignore &)'
src\util\AttachToConsole.cpp(17): note: 'std::_Ignore &std::_Ignore::operator =(const std::_Ignore &)': cannot convert 'this' pointer from 'const std::_Ignore' to 'std::_Ignore &'
src\util\AttachToConsole.cpp(17): note: Conversion loses qualifiers
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\tuple(125): note: or       'const std::_Ignore &std::_Ignore::operator =(const _Ty &) noexcept const'
src\util\AttachToConsole.cpp(17): note: Failed to specialize function template 'const std::_Ignore &std::_Ignore::operator =(const _Ty &) noexcept const'
src\util\AttachToConsole.cpp(17): note: With the following template arguments:
src\util\AttachToConsole.cpp(17): note: '_Ty=unknown-type'
src\util\AttachToConsole.cpp(17): note: while trying to match the argument list '(const std::_Ignore, unknown-type)'

Comment thread src/util/AttachToConsole.cpp Outdated
@brian6932
brian6932 force-pushed the fix/missing-includes-pch-off branch from 151017a to 7920cf2 Compare May 11, 2024 14:34
@pajlada
pajlada enabled auto-merge (squash) May 11, 2024 16:52
@pajlada
pajlada merged commit 5c539eb into Chatterino:master May 11, 2024
babicekmarek pushed a commit to babicekmarek/streamally-chatterino that referenced this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants