Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1648

Linker error with Node.js 20.10.0 on Windows

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.1.3
    • Affects Version/s: None
    • Component/s: Build, CI
    • None
    • Iteration Pterodactyl, Iteration Qantassaurus, Iteration Rajasaurus, Iteration Scutellosaurus, Iteration Triceratops
    • Not Needed

      https://github.com/mongodb-js/mongosh/pull/1750, compile_artifact on windows-64-vs2019-large:

      [2023/11/23 14:34:24.301]      Creating library out\Release\node.lib and object out\Release\node.exp
      [2023/11/23 14:34:24.426] LIBCMT.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library [C:\data\mci\02c3b01f9d8e0585944e4f88bb055cb4\tmp\boxednode\mongosh\node-v20.10.0\node.vcxproj]
      [2023/11/23 14:34:24.442] bson-static-for-libmongocrypt.lib(bson-context.c.obj) : error LNK2001: unresolved external symbol __imp_srand [C:\data\mci\02c3b01f9d8e0585944e4f88bb055cb4\tmp\boxednode\mongosh\node-v20.10.0\node.vcxproj]
      [2023/11/23 14:34:24.551] bson-static-for-libmongocrypt.lib(bson-context.c.obj) : error LNK2001: unresolved external symbol __imp_rand [C:\data\mci\02c3b01f9d8e0585944e4f88bb055cb4\tmp\boxednode\mongosh\node-v20.10.0\node.vcxproj]
      [2023/11/23 14:34:24.551] out\Release\node.exe : fatal error LNK1120: 2 unresolved externals [C:\data\mci\02c3b01f9d8e0585944e4f88bb055cb4\tmp\boxednode\mongosh\node-v20.10.0\node.vcxproj]
      [2023/11/23 14:34:24.730]   ✖  Failed: Command failed: .\vcbuild.bat no-shared-roheap openssl-no-asm projgen release vs2019 link-module ./lib-boxednode/mongosh.js (code 1)
      

      Some relevant context about the initial warning in SO: https://stackoverflow.com/a/3007915/688904

            Assignee:
            kevin.mas@mongodb.com Kevin Mas Ruiz
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: