When creating a solid brush (cppwinrt) for a textblock I get errors when building, using:
void MainPage::myStyle(Controls::TextBlock & block)
{
block.FontSize(72.0);
block.Foreground(Media::SolidColorBrush(Windows::UI::Colors::Orange()));
block.VerticalAlignment(VerticalAlignment::Center);
}
error: LNK2019 unresolved external symbol "public: __thiscall winrt::Windows::UI::Xaml::Media::SolidColorBrush::SolidColorBrush(struct winrt::Windows::UI::Color const &)"
The error goes when I take the solidbrush out and I've also tried other versions of the solidbrush with the same error.
You need to
to use types from namespace
winrt::Windows::UI::Xaml::Media
. This is documented under Get started with C++/WinRT: