<div dir="ltr"><div dir="ltr">Hi,</div><div dir="ltr"><br></div><div dir="ltr">I am new to LLVM and wanted to experiment with the Kaleidoscope example. My PC is a Windows 64 bit system. I managed to build LLVM from source with CMake. I managed to build the examples of Kaleidoscope with Visual Studio 15 2017 from the .vcxproj file. The built toy.exe from chapter 8 runs well from the command line and I could enter the function definition for average as in the tutorial. toy wrote output.o to D:\llvm.bld\Debug\bin.</div><div dir="ltr"><br></div><div dir="ltr">However, when I would like to compile and link the main.cpp as given in the tutorial I get:</div><div dir="ltr">clang++.exe: error: linker command failed with exit code 1143 (use -v to see invocation).</div><div><br></div><div>The full verbose output is copied below. How do you compile and link main.cpp and output.o on a Windows 64 bit PC?</div><div><br></div><div>Greetings,</div><div><br></div><div>Ad Huikeshoven </div><div dir="ltr"><div><br></div><div><div>D:\llvm.bld\Debug\bin>clang++ main.cpp output.o -o main -v</div><div>clang version 7.0.0 (tags/RELEASE_700/final)</div><div>Target: x86_64-pc-windows-msvc</div><div>Thread model: posix</div><div>InstalledDir: D:\LLVM\bin</div><div> "D:\\LLVM\\bin\\clang++.exe" -cc1 -triple x86_64-pc-windows-msvc19.16.27025 -emit-obj -mrelax-all -mincremental-linker-compatible -disable-free -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -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 "D:\\LLVM\\lib\\clang\\7.0.0" -internal-isystem "D:\\LLVM\\lib\\clang\\7.0.0\\include" -internal-isystem "D:\\VisualStudio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\include" -internal-isystem "D:\\Windows Kits\\10\\Include\\10.0.17763.0\\ucrt" -internal-isystem "D:\\Windows Kits\\10\\include\\10.0.17763.0\\shared" -internal-isystem "D:\\Windows Kits\\10\\include\\10.0.17763.0\\um" -internal-isystem "D:\\Windows Kits\\10\\include\\10.0.17763.0\\winrt" -fdeprecated-macro -fdebug-compilation-dir "D:\\llvm.bld\\Debug\\bin" -ferror-limit 19 -fmessage-length 120 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.16.27025 -std=c++14 -fdelayed-template-parsing -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o "C:\\Users\\Ad\\AppData\\Local\\Temp\\main-884d07.o" -x c++ main.cpp</div><div>clang -cc1 version 7.0.0 based upon LLVM 7.0.0 default target x86_64-pc-win32</div><div>#include "..." search starts here:</div><div>#include <...> search starts here:</div><div> D:\LLVM\lib\clang\7.0.0\include</div><div> D:\VisualStudio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include</div><div> D:\Windows Kits\10\Include\10.0.17763.0\ucrt</div><div> D:\Windows Kits\10\include\10.0.17763.0\shared</div><div> D:\Windows Kits\10\include\10.0.17763.0\um</div><div> D:\Windows Kits\10\include\10.0.17763.0\winrt</div><div>End of search list.</div><div> "D:\\VisualStudio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX64\\x64\\link.exe" -out:main -defaultlib:libcmt "-libpath:D:\\VisualStudio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x64" "-libpath:D:\\Windows Kits\\10\\Lib\\10.0.17763.0\\ucrt\\x64" "-libpath:D:\\Windows Kits\\10\\Lib\\10.0.17763.0\\um\\x64" -nologo "C:\\Users\\Ad\\AppData\\Local\\Temp\\main-884d07.o" output.o</div><div>clang++.exe: error: linker command failed with exit code 1143 (use -v to see invocation)</div></div></div></div>