<div dir="ltr"><span style="font-size:12.8px">> clang++.exe -v -o hello.exe hello.cxx</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Ok. Running with clang 6 (trunk):</span></div><div><span style="font-size:12.8px"><br></span></div><div><div><span style="font-size:12.8px">C:\Tests\Build2\hello\hello>clang++.exe -v -o hello.exe hello.cxx</span></div><div><span style="font-size:12.8px">clang version 6.0.0 (<a href="https://llvm.org/git/clang.git">https://llvm.org/git/clang.git</a> 9dec99fdb04cb694bdaa3ee12e0796bdb7f2a781) (<a href="https://llvm.org/git/llvm.git">https://llvm.org/git/llvm.git</a> 30bcf2f789213e1c6dfc18bd5b3af90630e94eca)</span></div><div><span style="font-size:12.8px">Target: x86_64-pc-windows-msvc</span></div><div><span style="font-size:12.8px">Thread model: posix</span></div><div><span style="font-size:12.8px">InstalledDir: C:\LLVM\build\bin</span></div><div><span style="font-size:12.8px"> "C:\\LLVM\\build\\bin\\clang++.exe" -cc1 -triple x86_64-pc-windows-msvc19.11.25547 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.cxx -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\\hello" -ferror-limit 19 -fmessage-length 81 -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 "C:\\Users\\username\\AppData\\Local\\Temp\\hello-174fb1.o" -x c++ hello.cxx</span></div><div><span style="font-size:12.8px">clang -cc1 version 6.0.0 based upon LLVM 6.0.0svn default target x86_64-pc-windows-msvc</span></div><div><span style="font-size:12.8px">#include "..." search starts here:</span></div><div><span style="font-size:12.8px">#include <...> search starts here:</span></div><div><span style="font-size:12.8px"> C:\LLVM\build\lib\clang\6.0.0\include</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\ATLMFC\include</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt</span></div><div><span style="font-size:12.8px">End of search list.</span></div><div><span style="font-size:12.8px"> "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\bin\\HostX64\\x64\\link.exe" -out:hello.exe -defaultlib:libcmt -nologo "C:\\Users\\username\\AppData\\Local\\Temp\\hello-174fb1.o"</span></div><div><span style="font-size:12.8px">hello-174fb1.o : 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)</span></div><div><span style="font-size:12.8px">hello-174fb1.o : 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)</span></div><div style="font-size:12.8px"><br></div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Running with clang 5:</div><div style="font-size:12.8px"><br></div><div><div><span style="font-size:12.8px">C:\Tests\Build2\hello\hello>clang++.exe -v -o hello.exe hello.cxx</span></div><div><span style="font-size:12.8px">clang version 5.0.0 (tags/RELEASE_500/final)</span></div><div><span style="font-size:12.8px">Target: x86_64-pc-windows-msvc</span></div><div><span style="font-size:12.8px">Thread model: posix</span></div><div><span style="font-size:12.8px">InstalledDir: C:\LLVM5\bin</span></div><div><span style="font-size:12.8px"> "C:\\LLVM5\\bin\\clang++.exe" -cc1 -triple x86_64-pc-windows-msvc19.11.25547 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.cxx -mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -v -dwarf-column-info -debugger-tuning=gdb -resource-dir "C:\\LLVM5\\lib\\clang\\5.0.0" -internal-isystem "C:\\LLVM5\\lib\\clang\\5.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\\hello" -ferror-limit 19 -fmessage-length 81 -fms-extensions -fms-compatibility -fms-compatibility-version=19.11.25547 -std=c++14 -fdelayed-template-parsing -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o "C:\\Users\\username\\AppData\\Local\\Temp\\hello-e0a0f7.o" -x c++ hello.cxx</span></div><div><span style="font-size:12.8px">clang -cc1 version 5.0.0 based upon LLVM 5.0.0 default target x86_64-pc-windows-msvc</span></div><div><span style="font-size:12.8px">#include "..." search starts here:</span></div><div><span style="font-size:12.8px">#include <...> search starts here:</span></div><div><span style="font-size:12.8px"> C:\LLVM5\lib\clang\5.0.0\include</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\ATLMFC\include</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um</span></div><div><span style="font-size:12.8px"> C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt</span></div><div><span style="font-size:12.8px">End of search list.</span></div><div><span style="font-size:12.8px"> "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\bin\\HostX64\\x64\\link.exe" -out:hello.exe -defaultlib:libcmt -nologo "C:\\Users\\username\\AppData\\Local\\Temp\\hello-e0a0f7.o"</span></div><div><span style="font-size:12.8px">hello-e0a0f7.o : 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)</span></div><div><span style="font-size:12.8px">hello-e0a0f7.o : 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)</span></div><div style="font-size:12.8px"><br></div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">By the way, those "locally defined symbol" warnings are referenced here:</div><div style="font-size:12.8px"><a href="https://stackoverflow.com/questions/42545078/clang-version-5-and-lnk4217-warning">https://stackoverflow.com/questions/42545078/clang-version-5-and-lnk4217-warning</a></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Regards,</div><div style="font-size:12.8px">Jack</div><div style="font-size:12.8px"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 7, 2017 at 10:41 AM, 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>
> ld exe{hello}<br>
> LINK : error LNK2001: unresolved external symbol mainCRTStartup<br>
> hello.lib(hello.lib.obj) : error LNK2019: unresolved external symbol<br>
> __acrt_iob_func referenced in function printf<br>
> hello.lib(hello.lib.obj) : error LNK2019: unresolved external symbol<br>
> __stdio_common_vfprintf referenced in function _vfprintf_l<br>
<br>
Thanks for the logs. Looks like we are almost there. It seems Clang<br>
is linking in something extra (compared to VC). Could you run this<br>
and send the output:<br>
<br>
clang++.exe -v -o hello.exe hello.cxx<br>
<br>
Thanks,<br>
Boris<br>
</blockquote></div><br></div>