Hi, I've a strange problems with Clang 3.4. I'm on Gentoo and I'm using the official Gentoo version 3.4-r100. I'm using the version 0.0_p20131222 of libcxx and libcxxrt.
My code is working fine when optimizations are at low level (-O0 -O1 -Os) but when I use higher levels (-O2 -O3 -Ofast), my code does not link: release/src/ast/Operator.cpp.o: In function `eddic::ast::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, eddic::ast::Operator)': /home/wichtounet/dev/eddic/src/ast/Operator.cpp:15: undefined reference to `std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<< <char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)' clang: error: linker command failed with exit code 1 (use -v to see invocation) I'm using clang++ to compile and link. I'm using -std=c++1y -stdlib=libc++ options. The code in question does not seem to be the cause of the problem: std::ostream& ast::operator<< (std::ostream& stream, ast::Operator op){ std::string value = "asd"; return stream << value; } What I'm doing wrong ? Could it be a problem in one of the optimizations ? (Between O2 and Os) Thanks for any help, I'm kind of stuck on that for some time now. Baptiste Wicht -- Baptiste Wicht, HES-SO University of applied Sciences My personal website - http://baptiste-wicht.com
_______________________________________________ cfe-users mailing list cfe-users@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users