<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Le 5 févr. 2011 à 15:05, Larry Evans a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On 02/05/11 07:52, Jean-Daniel Dupas wrote:<br><blockquote type="cite"><br></blockquote><blockquote type="cite">Le 5 févr. 2011 à 14:26, Larry Evans a écrit :<br></blockquote>[snip]<br><blockquote type="cite"><blockquote type="cite">Am I missing something?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I don't have access to my linux machine right now, so I cannot test, but I think you can link on libstdc++ to get the missing symbols (just adding -lstdc++ to the linker flags should be enough).<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">It should not conflict with libc++ symbols as libc++ uses inline namespace, and so mangle the standard symbols differently than the libstdc++.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">This is what we use to do on OS X before we got a separate libc++abi library.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">-- Jean-Daniel<br></blockquote><br>Thanks Jean; however, I'm getting the same error:<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><div><br></div>OK. In fact, you have to add this flag to the libc++ LDFLAGS (in buildit script).</div><div>Make sure to also add -std=c++0x  to the cflags to enable latest clang enhancements.</div><div><br></div><div><div>    EXTRA_FLAGS="-std=c++0x"</div><div>    LDSHARED_FLAGS="-o libc++.so.1.0 \</div><div>        -shared -nodefaultlibs -Wl,-soname,libc++.so.1 \</div><div>        -lpthread -lrt -lc -lstdc++"</div><div><br></div><div><br></div><div>As the library soname is libc++.so.1, you have to create a /usr/lib/libc++.so.1 symlink that point to the library. Else you will get a "library not found" runtime error.</div></div><div><br></div><div>After theses changes, I was able to compile a simple hello world program.</div><div><br></div><div>--------- hello.cpp</div><div><div>#include <iostream></div><div><br></div><div>int main (int argc, char * const argv[]) {</div><div>    // insert code here...</div><div>    std::cout << "Hello, World!\n";</div><div>    return 0;</div><div>}</div></div><div>------------------------</div><div><br></div><div>Unfortunalty, this simple code does not run properly. It prints "Hello World", and then a lot of garbage (and sometimes segfault too).</div><div><br></div><div>But this may be a good base to start hacking on libc++.</div><div><br></div><br><div>
<div>-- Jean-Daniel</div><div><br></div><div><br></div><br class="Apple-interchange-newline">
</div>
<br></body></html>