Which namespace is CreateStreamOverRandomAccessStream in RRS feed

  • Question

  • I just add the image saving code from "Direct2D save to image file sample' to my project and add 'shcore.h' header file to make CreateStreamOverRandomAccessStream declared. However, the compiler still report link error:

    1>MainPage.xaml.obj : error LNK2019: unresolved external symbol _CreateStreamOverRandomAccessStream@12 referenced in function "long __cdecl CreateStreamOverRandomAccessStream(struct Windows::Storage::Streams::IRandomAccessStream ^,struct _GUID const &,void * *)" (?CreateStreamOverRandomAccessStream@@YAJP$AAUIRandomAccessStream@Streams@Storage@Windows@@ABU_GUID@@PAPAX@Z)
    I've searched on MSDN and this forum but could not find which namepsce is CreateStreamOverRandomAccessStream in. Could someone help, thanks.
    Thursday, October 25, 2012 10:48 PM


  • Function CreateStreamOverRandomAccessStream is declared in shcore.h as you have noticed, and its code is in shcore.lib. (shcore.lib is in "Direct2D save to image file sample" linker properties).

    You should add shcore.lib in your linker properties, in "Additional Dependencies".

    • Marked as answer by Leonard Friday, October 26, 2012 4:14 AM
    Thursday, October 25, 2012 11:21 PM