<div dir="ltr">Hi,<br><div><br>> Could you re-build it with -V and send the output?</div><div><br></div><div>Here it is:</div><div><br></div><div>C:\Tests\Build2\hello\clang-6>b -V<br>clang++ -v<br>clang++ -dumpmachine<br>clang++ -print-search-dirs<br>clang++ -x c++ -v -E -<br>cxx hello@C:\Tests\Build2\hello\clang-6\<br>  cxx        clang++@C:\LLVM\build\bin\clang++.exe<br>  id         clang<br>  version    6.0.0 (<a href="https://llvm.org/git/clang.git">https://llvm.org/git/clang.git</a> 13391081b0b149da4168377ceb1b4af083407d3b) (<a href="https://llvm.org/git/llvm.git">https://llvm.org/git/llvm.git</a> 48d461fa384512bd9d5e23aba9a2fc828d5154e4)<br>  major      6<br>  minor      0<br>  patch      0<br>  build      (<a href="https://llvm.org/git/clang.git">https://llvm.org/git/clang.git</a> 13391081b0b149da4168377ceb1b4af083407d3b) (<a href="https://llvm.org/git/llvm.git">https://llvm.org/git/llvm.git</a> 48d461fa384512bd9d5e23aba9a2fc828d5154e4)<br>  signature  clang version 6.0.0 (<a href="https://llvm.org/git/clang.git">https://llvm.org/git/clang.git</a> 13391081b0b149da4168377ceb1b4af083407d3b) (<a href="https://llvm.org/git/llvm.git">https://llvm.org/git/llvm.git</a> 48d461fa384512bd9d5e23aba9a2fc828d5154e4)<br>  checksum   dca55fecdd766d5a49b5a212e5ee66aacaf084525b539e106d71a7c4ca13863d<br>  target     x86_64-microsoft-win32-msvc14.1 (x86_64-pc-windows-msvc)<br>  inc dirs<br>    C:\LLVM\build\lib\clang\6.0.0\include\<br>    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\ATLMFC\include\<br>    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\<br>    C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um\<br>    C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\<br>    C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared\<br>    C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\<br>    C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt\<br>  lib dirs<br>    C:\LLVM\build\lib\clang\6.0.0\<br>bin hello@C:\Tests\Build2\hello\clang-6\<br>  target     x86_64-microsoft-win32-msvc14.1<br>lib --version<br><a href="http://bin.ar">bin.ar</a> hello@C:\Tests\Build2\hello\clang-6\<br>  ar         lib@C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\lib.exe<br>  id         msvc<br>  signature  Microsoft (R) Library Manager Version 14.11.25547.0<br>  checksum   07a750c5776ef44946e2af04c136606cc692655032d453e7f7852cdeb2036eac<br>clang++ -w -MQ ^ -x c++ -MD -E -frewrite-includes -MF - -o C:\Tests\Build2\hello\clang-6\hello.exe.obj.ii ../hello/hello.cxx<br>clang++ -E -x c++ C:\Tests\Build2\hello\clang-6\hello.exe.obj.ii<br>clang++ -o hello.exe.obj -c -x c++ C:\Tests\Build2\hello\clang-6\hello.exe.obj.ii<br>clang++ -o hello hello.exe.obj<br>hello.exe.obj : warning LNK4217: locally defined symbol __std_terminate imported in function "int `public: static unsigned __int64 __cdecl std::char_traits<char>::length(char const * const)'::`1'::dtor$2" (?dtor$2@?0??length@?$char_traits@D@std@@SA_KQEBD@Z@4HA)<br>hello.exe.obj : warning LNK4217: locally defined symbol _CxxThrowException imported in function "public: void __cdecl std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QEAAXH_N@Z)<br>info: scheduler statistics:<br><br>  thread_max_active      8<br>  thread_max_total       256<br>  thread_helpers         4<br>  thread_max_waiting     4<br><br>  task_queue_depth       32<br>  task_queue_full        0<br><br>  wait_queue_slots       67<br>  wait_queue_collisions  0<br><br><br><br></div><div><br></div><div>Those linker warnings are a Clang bug, I think. I've updated the LLVM trunk and those warnings now appear even if I compile a simple hello world directly with clang.</div><div><br></div><div><br></div><div><br></div><div>> None of these values indicate the runtime being used. There can actually<br>> be multiple (versions of) toolchains installed in a single VSINSTALLDIR.</div><div><br></div><div>You are right. But I think I found a way to know that here:</div><div><a href="https://stackoverflow.com/questions/11946294/dump-include-paths-from-g">https://stackoverflow.com/questions/11946294/dump-include-paths-from-g</a></div><div><br></div><div><br></div><div>C:\Tests\Build2\hello\clang-6>clang++ -E -x c++ - -v < nul<br>clang version 6.0.0 (<a href="https://llvm.org/git/clang.git">https://llvm.org/git/clang.git</a> 13391081b0b149da4168377ceb1b4af083407d3b) (<a href="https://llvm.org/git/llvm.git">https://llvm.org/git/llvm.git</a> 48d461fa384512bd9d5e23aba9a2fc828d5154e4)<br>Target: x86_64-pc-windows-msvc<br>Thread model: posix<br>InstalledDir: C:\LLVM\build\bin<br> "C:\\LLVM\\build\\bin\\clang++.exe" -cc1 -triple x86_64-pc-windows-msvc19.11.25547 -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -v -resource-dir "C:\\LLVM\\build\\lib\\clang\\6.0.0" -internal-isystem "C:\\LLVM\\build\\lib\\clang\\6.0.0\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\ATLMFC\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\winrt" -fdeprecated-macro -fdebug-compilation-dir "C:\\Tests\\Build2\\hello\\clang-6" -ferror-limit 19 -fmessage-length 120 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.11.25547 -std=c++14 -fdelayed-template-parsing -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fseh-exceptions -fdiagnostics-show-option -fcolor-diagnostics -o - -x c++ -<br>clang -cc1 version 6.0.0 based upon LLVM 6.0.0svn default target x86_64-pc-windows-msvc<br>#include "..." search starts here:<br>#include <...> search starts here:<br> C:\LLVM\build\lib\clang\6.0.0\include<br> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\ATLMFC\include<br> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include<br> C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um<br> C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt<br> C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared<br> C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um<br> C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt<br>End of search list.<br># 1 "<stdin>"<br># 1 "<built-in>" 1<br># 1 "<built-in>" 3<br># 373 "<built-in>" 3<br># 1 "<command line>" 1<br># 1 "<built-in>" 2<br># 1 "<stdin>" 2<br><br><br>C:\Tests\Build2\hello\clang-6></div><div><br></div><div><br></div><div><br></div><div>The compiler version is in the "-triple" option (x86_64-pc-windows-msvc19.11.25547) and the Visual Studio version can be found in the headers (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include).</div><div><br></div><div><br></div><div>Regards,</div><div>Jack</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 5, 2017 at 12:33 PM, Boris Kolpackov <span dir="ltr"><<a href="mailto:boris@codesynthesis.com" target="_blank">boris@codesynthesis.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Username I Wanted Was Already Taken <<a href="mailto:usernameiwantedwasalreadytaken@gmail.com">usernameiwantedwasalreadytake<wbr>n@gmail.com</a>> writes:<br>
<br>
> This worked. The program compiled, but the executable produced does not<br>
> have a ".exe" extension. If I manually rename "hello" to "hello.exe", it<br>
> works.<br>
<br>
Could you re-build it with -V and send the output?<br>
<br>
<br>
> If we are to assume that (which sounds reasonable), build2 can check the<br>
> environment for the specific version of the MSVC runtime that is loaded.<br>
> There is still no guarantee that Clang will use this runtime (since the<br>
> user may have more than one version of MSVC installed in his machine), but<br>
> I think this is better than nothing.<br>
><br>
> For example, in my setup the following environment variables are defined<br>
> when running from a development command line:<br>
><br>
> VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual<br>
> Studio\2017\Community\Common7\<wbr>Tools\<br>
> VSCMD_ARG_app_plat=Desktop<br>
> VSCMD_ARG_HOST_ARCH=x64<br>
> VSCMD_ARG_TGT_ARCH=x64<br>
> VSCMD_VER=15.4.5<br>
> VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\<br>
<br>
None of these values indicate the runtime being used. There can actually<br>
be multiple (versions of) toolchains installed in a single VSINSTALLDIR.<br>
Which one Clang is using is anyone's guess.<br>
<br>
I think this value should come from the compiler. It may make sense to<br>
ask on cfe-dev if there is any way to query it (along with the MSVC and<br>
SDK bin directories). Failed that, the approach that's based on analyzing<br>
the header search paths I suggested earlier will have to do.<br>
<span class="HOEnZb"><font color="#888888"><br>
Boris<br>
</font></span></blockquote></div><br></div>