<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64737>64737</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc++] Link failures of istringstream/ostringstream/stringstream::str() on Windows
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            pfusik
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          pfusik
      </td>
    </tr>
</table>

<pre>
     cat strwin.cpp
    #include <iostream>
    #include <sstream>

    int main() {
      std::cout << std::stringstream("hi").str();
    }

    cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS='clang;lld' -DLLVM_ENABLE_RUNTIMES='libcxx' -DLLVM_TARGETS_TO_BUILD=X86 -DLIBCXX_ABI_UNSTABLE=ON ..\llvm
    ninja cxx
    bin\clang-cl /std:c++17 \src\temp\strwin.cpp -Iinclude\c++\v1 lib\c++.lib
    strwin-b8a36d.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::__2::basic_string<char,struct std::__2::char_traits<char>,class std::__2::allocator<char> > __cdecl std::__2::basic_stringstream<char,struct std::__2::char_traits<char>,class std::__2::allocator<char> >::str(void)const " (__imp_?str@?$basic_stringstream@DU?$char_traits@D@__2@std@@V?$allocator@D@23@@__2@std@@QEBA?AV?$basic_string@DU?$char_traits@D@__2@std@@V?$allocator@D@23@@23@XZ) referenced in function main
    strwin.exe : fatal error LNK1120: 1 unresolved externals
    clang-cl: error: linker command failed with exit code 1120 (use -v to see invocation)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VcFy4jgQ_ZrmooKyJdvgAwewYYodQmYTks3uxSVLApTIEiXJJPP3W8JMnGEztZetPVBY3U-vX0vdLeqc3GshppDOAePjrnXyBTCGtBzQ1h-MnXa2QW349yli1CPn7avU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