<div dir="ltr"><div><div>Hi, <br><br>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. <br>
<br></div>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: <br><br>release/src/ast/Operator.cpp.o: In function `eddic::ast::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, eddic::ast::Operator)':<br>
/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&)'<br>
clang: error: linker command failed with exit code 1 (use -v to see invocation)<br><br></div>I'm using clang++ to compile and link. I'm using -std=c++1y -stdlib=libc++ options. <br clear="all"><div><div><div><div>
<br></div><div>The code in question does not seem to be the cause of the problem: <br><br>std::ostream& ast::operator<< (std::ostream& stream, ast::Operator op){<br>    std::string value = "asd";<br>
    return stream << value;<br>}<br><br></div><div>What I'm doing wrong ? <br></div><div>Could it be a problem in one of the optimizations ? (Between O2 and Os)<br></div><div><br>Thanks for any help, I'm kind of stuck on that for some time now. <br>
<br></div><div>Baptiste Wicht<br></div><div><br>-- <br>Baptiste Wicht, HES-SO University of applied Sciences<br>My personal website - <a href="http://baptiste-wicht.com" target="_blank">http://baptiste-wicht.com</a>
</div></div></div></div></div>