• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by John Dev


01 Dec, 2024

Updated at 05 Dec, 2024

Why is link.exe failing? exit code: 1181

I'm following this tutorial and having this issue unless I first build the dll code, and copy the .lib file to the parent folder of the exe's source code.

There is no build script and there no manual copying in this guide. Cargo just figures it all out.
My output:

   Compiling hello_runner v0.1.0 (C:\Users\nobody\Documents\code\compiled\rust\hello\hello_runner)
error: linking with `link.exe` failed: exit code: 1181
  |
  = note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\nobody\\AppData\\Local\\Temp\\rustcfDZRPO\\symbols.o" "C:\\Users\\nobody\\Documents\\code\\compiled\\rust\\hello\\target\\debug\\deps\\hello_runner.37ti7aqepqar6m0a9qdjhatgw.rcgu.o" "C:\\Users\\nobody\\Documents\\code\\compiled\\rust\\hello\\target\\debug\\deps\\hello_runner.5hsi1jyoqqven15z7ahv5nxql.rcgu.o" "C:\\Users\\nobody\\Documents\\code\\compiled\\rust\\hello\\target\\debug\\deps\\hello_runner.603gdiqi163s26tug7cza0z6t.rcgu.o" "C:\\Users\\nobody\\Documents\\code\\compiled\\rust\\hello\\target\\debug\\deps\\hello_runner.8v5l4ollp8sxsi5c6zyebmmp0.rcgu.o" "C:\\Users\\nobody\\Documents\\code\\compiled\\rust\\hello\\target\\debug\\deps\\hello_runner.9n8f1dzftc3rid9u6c6sdcv1r.rcgu.o" "C:\\Users\\nobody\\Documents\\code\\compiled\\rust\\hello\\target\\debug\\deps\\hello_runner.dkc78uc6xefvd3yeuvjmwydv6.rcgu.o" "C:\\Users\\nobody\\Documents\\code\\compiled\\rust\\hello\\target\\debug\\deps\\hello_runner.5iohkj009p8hi1ko36vgbz4y5.rcgu.o" "hello_dll.dll.lib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-b84ff5acd6bc244a.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-48b6b1a2a90a15be.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libmemchr-77f16b23eaf07898.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libwindows_targets-44d066234198c8a4.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-12d696bf58c9e9c7.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd_detect-2206e5523d327069.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-a9142fbefbdf1faf.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-e7de328891fff36a.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-1356fe3b4850b6e6.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-314940f2a2940707.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-9dfd12b559455ea0.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-42049fa76a54b99d.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-34a43d83f1ad639d.rlib" "C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-5c59788ced62b43b.rlib" "kernel32.lib" "kernel32.lib" "advapi32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "dbghelp.lib" "/defaultlib:msvcrt" "/NXCOMPAT" "/OUT:C:\\Users\\nobody\\Documents\\code\\compiled\\rust\\hello\\target\\debug\\deps\\hello_runner.exe" "/OPT:REF,NOICF" "/DEBUG" "/PDBALTPATH:%_PDB%" "/NATVIS:C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\nobody\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis"
  = note: LINK : fatal error LNK1181: cannot open input file 'hello_dll.dll.lib'␍


error: could not compile `hello_runner` (bin "hello_runner") due to 1 previous error

1 post - 1 participant

Read full topic