clang++ and std::wcin - compiles, doesn't link

#include <iostream>
#include <limits>
int main()
	std::wcin.ignore(std::numeric_limits<std::streamsize>::max(), L'\n');
>clang++ -std=c++11 -o test.exe main.cpp
C:/DOCUME~1/LB/LOCALS~1/Temp/main-455071.o:fake:(.text+0x7e): undefined reference to `std::basic_istream<wchar_t, std::char_traits<wchar_t> >::ignore(int, int)'
collect2: ld returned 1 exit status
clang++: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)

It works if I use std::cin instead of std::wcin, but I'm using wide-character input and output for the most part and I've heard it is not good to mix them. Is there something I need to link to for this to work? Some searching on Google hasn't really helped. Note: all other uses of std::wcin work fine.
Last edited on
works fine with version 3.1 (on linux)

> linker (via gcc) command failed with exit code 1 (use -v to see invocation)
Do that.
The series of dashes in the path names are where I excluded my username for privacy.
Last edited on
I've tried on multiple systems with various installs, to no avail.
Looks like a mingw-specific problem. That program works on my Linux both when linking against GNU libstdc++ and against LLVM libc++.

(tested clang++-3.1 against libstdc++-4.4.4, libstdc++-4.7.2, and libc++-svn)
Last edited on
Topic archived. No new replies allowed.