<div dir="rtl"><div dir="ltr">Hi</div><div dir="ltr"><br></div><div dir="ltr">You need -lstdc++ in linking stage, both with gcc and clang.</div><div dir="ltr"><br></div><div dir="ltr">Yaron</div><div dir="ltr"><br></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote"><div dir="ltr">2014-07-12 1:53 GMT+03:00 Edward Diener <span dir="ltr"><<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a>></span>:</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I built the latest clang on Windows in gcc mode using Cmake and Ninja. When I compile a source file all the gcc header files are found and the compilation succeeds but when I link none of the gcc libraries appear to be found. Here is the compilation output for a single source file:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
clang-linux.compile.c++.<u></u>without-pth ..\..\..\bin.v2\libs\mpl\test\<u></u>bool.test\clang-linux-3.5.0\<u></u>debug\bool.obj<br>
<br>
"C:/Programming/<u></u>VersionControl/bninja_<u></u>installed_clang/bin/clang.exe" -c -x c++ -O0 -g -fno-inline -Wall -g -DBOOST_ALL_NO_LIB=1 -I"..\..\.." -o "..\..\..\bin.v2\libs\mpl\<u></u>test\bool.test\clang-linux-3.<u></u>5.0\debug\bool.obj" "bool.cpp"<br>
<br>
</blockquote>
<br>
Here is the error output for the link step:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
clang-linux.link ..\..\..\bin.v2\libs\mpl\test\<u></u>bool.test\clang-linux-3.5.0\<u></u>debug\bool.exe<br>
<br>
"C:/Programming/<u></u>VersionControl/bninja_<u></u>installed_clang/bin/clang.exe" -o "..\..\..\bin.v2\libs\mpl\<u></u>test\bool.test\clang-linux-3.<u></u>5.0\debug\bool.exe" -Wl,--start-group "..\..\..\bin.v2\libs\mpl\<u></u>test\bool.test\clang-linux-3.<u></u>5.0\debug\bool.obj" -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -g<br>
<br>
..\..\..\bin.v2\libs\mpl\test\<u></u>bool.test\clang-linux-3.5.0\<u></u>debug\bool.obj: In function `_cxx_global_var_init':<br>
c:/MinGW/lib/gcc/mingw32/4.8.<u></u>1/include/c++/iostream:74: undefined reference to `std::ios_base::Init::Init()'<br>
..\..\..\bin.v2\libs\mpl\test\<u></u>bool.test\clang-linux-3.5.0\<u></u>debug\bool.obj: In function `_dtor__ZStL8__ioinit':<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/<u></u>bool.cpp:74: undefined reference to `std::ios_base::Init::~Init()'<br>
..\..\..\bin.v2\libs\mpl\test\<u></u>bool.test\clang-linux-3.5.0\<u></u>debug\bool.obj: In function `ZN5boost13report_errorsEv':<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:130: undefined reference to `std::cerr'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:132: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:132: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:132: undefined reference to `std::ostream::operator<<(std:<u></u>:ostream& (*)(std::ostream&))'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:138: undefined reference to `std::cerr'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:138: undefined reference to `std::ostream::operator<<(int)<u></u>'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:138: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:138: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:138: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:138: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:138: undefined reference to `std::ostream::operator<<(std:<u></u>:ostream& (*)(std::ostream&))'<br>
..\..\..\bin.v2\libs\mpl\test\<u></u>bool.test\clang-linux-3.5.0\<u></u>debug\bool.obj: In function `ZN5boost6detail16test_failed_<u></u>implEPKcS2_iS2_':<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:65: undefined reference to `std::cerr'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:66: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:66: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:66: undefined reference to `std::ostream::operator<<(int)<u></u>'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:66: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:66: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:66: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:66: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:66: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:66: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:66: undefined reference to `std::ostream::operator<<(std:<u></u>:ostream& (*)(std::ostream&))'<br>
..\..\..\bin.v2\libs\mpl\test\<u></u>bool.test\clang-linux-3.5.0\<u></u>debug\bool.obj: In function `ZN5boost6detail20report_<u></u>errors_remindEv':<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:53: undefined reference to `__cxa_guard_acquire'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:53: undefined reference to `__cxa_guard_release'<br>
C:\Programming\VersionControl\<u></u>modular-boost\libs\mpl\test/..<u></u>\..\..\boost/core/lightweight_<u></u>test.hpp:55: undefined reference to `__cxa_guard_abort'<br>
..\..\..\bin.v2\libs\mpl\test\<u></u>bool.test\clang-linux-3.5.0\<u></u>debug\bool.obj:(.eh_frame+<u></u>0x12b): undefined reference to `__gxx_personality_v0'<br>
collect2.exe: error: ld returned 1 exit status<br>
clang.exe: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)<br>
</blockquote>
<br>
Anybody have any idea why the link is failing ? It looks like clang is not searching any library paths but maybe it is something else.<br>
<br>
______________________________<u></u>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>