Repository navigation
Node.exe fails to link #40749
Copy link
Copy link
Closed
Labels
buildIssues and PRs related to Node.js builds or CI infrastructure.Issues and PRs related to Node.js builds or CI infrastructure.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Description
Version
16.13.0
Platform
Microsoft Windows NT 10.0.19043.0 x64
Subsystem
The standalone Interpretor
What steps will reproduce the bug?
1.Run vcbuild.bat
2.Wait for it to link node.exe
3.Observe linker error
How often does it reproduce? Is there a required condition?
Every time,No
What is the expected behavior?
It shouldn't generate any linker errors
What do you see instead?
Looking for Python
Python found in C:\Users\admin\AppData\Local\Programs\Python\Python36\\python.exe
Looking for NASM
Looking for Visual Studio 2022
Looking for Visual Studio 2019
Found MSVS version 16.0
configure --dest-cpu=x64
Node.js configure: Found Python 3.6.2...
←[1m←[32mINFO←[0m: configure completed successfully
Project files generated.
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
histogram.vcxproj -> ..\..\out\Release\lib\histogram.lib
uvwasi.vcxproj -> ..\..\out\Release\lib\uvwasi.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
v8_libplatform.vcxproj -> ..\..\out\Release\lib\v8_libplatform.lib
zlib.vcxproj -> ..\..\out\Release\lib\zlib.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
llhttp.vcxproj -> ..\..\out\Release\lib\llhttp.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
cares.vcxproj -> ..\..\out\Release\lib\cares.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
libuv.vcxproj -> ..\..\out\Release\lib\libuv.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
nghttp2.vcxproj -> ..\..\out\Release\lib\nghttp2.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
brotli.vcxproj -> ..\..\out\Release\lib\brotli.lib
Assemble
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
ngtcp2.vcxproj -> ..\..\out\Release\lib\ngtcp2.lib
Assemble
Assemble
Assemble
Assemble
Assemble
Assemble
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
Assemble
nghttp3.vcxproj -> ..\..\out\Release\lib\nghttp3.lib
Assemble
Assemble
Assemble
Assemble
Assemble
Assemble
Assemble
Assemble
Assemble
Assemble
Assemble
Assemble
Assemble
Assemble
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
v8_zlib.vcxproj -> ..\..\out\Release\lib\v8_zlib.lib
Assemble
Assemble
Assemble
Assemble
Assemble
Assemble
Assemble
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
openssl.vcxproj -> ..\..\out\Release\lib\openssl.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
icuucx.vcxproj -> ..\..\out\Release\lib\icuucx.lib
icui18n.vcxproj -> ..\..\out\Release\lib\icui18n.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
icutools.vcxproj -> ..\..\out\Release\lib\icutools.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
v8_libbase.vcxproj -> ..\..\out\Release\lib\v8_libbase.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
bytecode_builtins_list_generator.vcxproj -> ..\..\out\Release\\bytecode_builtins_list_generator.exe
torque_base.vcxproj -> ..\..\out\Release\lib\torque_base.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
torque.vcxproj -> ..\..\out\Release\\torque.exe
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
genccode.vcxproj -> ..\..\out\Release\\genccode.exe
icudata
generating object code for ../../deps/icu-tmp/icudt69l.dat
genccode: using architecture cpu=0 bits=64 big-endian=0
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
icudata.vcxproj -> ..\..\out\Release\lib\icudata.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
Creating library ..\..\out\Release\gen-regexp-special-case.lib and object ..\..\out\Release\gen-regexp-special-case.exp
openssl-cli.vcxproj -> ..\..\out\Release\\openssl-cli.exe
gen-regexp-special-case.vcxproj -> ..\..\out\Release\\gen-regexp-special-case.exe
node_js2c
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
run_gen-regexp-special-case_action
node_javascript.cc
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
v8_init.vcxproj -> ..\..\out\Release\lib\v8_init.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
v8_compiler.vcxproj -> ..\..\out\Release\lib\v8_compiler.lib
Assembling ..\..\deps\v8\src\heap\base\asm\x64\push_registers_masm.S...
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
special-case.cc
libnode.vcxproj -> out\Release\lib\libnode.lib
v8_base_without_compiler.vcxproj -> ..\..\out\Release\lib\v8_base_without_compiler.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
v8_initializers.vcxproj -> ..\..\out\Release\lib\v8_initializers.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
Creating library ..\..\out\Release\mksnapshot.lib and object ..\..\out\Release\mksnapshot.exp
mksnapshot.vcxproj -> ..\..\out\Release\\mksnapshot.exe
generating: "..\..\out\Release\obj\v8_snapshot\/snapshot.cc" "..\..\out\Release\obj\v8_snapshot\/embedded.S"
Assembling ..\..\out\Release\obj\v8_snapshot\\embedded.S...
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
snapshot.cc
v8_snapshot.vcxproj -> ..\..\out\Release\lib\v8_snapshot.lib
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
mkcodecache.vcxproj -> out\Release\\mkcodecache.exe
node_mksnapshot.vcxproj -> out\Release\\node_mksnapshot.exe
run_mkcodecache
node_mksnapshot
Using triplet "x64-windows" from "C:\Users\admin\Downloads\vcpkg-2020.06\vcpkg-2020.06\installed\x64-windows\"
node_snapshot.cc
node_code_cache.cc
Creating library out\Release\node.lib and object out\Release\node.exp
zlib.lib(adler32.obj) : error LNK2005: adler32 already defined in zlib.lib(zlib1.dll) [I:\node-v16.13.0.tar\node-v16.13.0\node.vcxproj]
zlib.lib(adler32.obj) : error LNK2005: adler32_combine already defined in zlib.lib(zlib1.dll) [I:\node-v16.13.0.tar\node-v16.13.0\node.vcxproj]
zlib.lib(adler32.obj) : error LNK2005: adler32_z already defined in zlib.lib(zlib1.dll) [I:\node-v16.13.0.tar\node-v16.13.0\node.vcxproj]
zlib.lib(crc32.obj) : error LNK2005: crc32 already defined in zlib.lib(zlib1.dll) [I:\node-v16.13.0.tar\node-v16.13.0\node.vcxproj]
zlib.lib(crc32.obj) : error LNK2005: crc32_combine already defined in zlib.lib(zlib1.dll) [I:\node-v16.13.0.tar\node-v16.13.0\node.vcxproj]
zlib.lib(crc32.obj) : error LNK2005: crc32_z already defined in zlib.lib(zlib1.dll) [I:\node-v16.13.0.tar\node-v16.13.0\node.vcxproj]
zlib.lib(crc32.obj) : error LNK2005: get_crc_table already defined in zlib.lib(zlib1.dll) [I:\node-v16.13.0.tar\node-v16.13.0\node.vcxproj]
out\Release\node.exe : fatal error LNK1169: one or more multiply defined symbols found [I:\node-v16.13.0.tar\node-v16.13.0\node.vcxproj]
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
buildIssues and PRs related to Node.js builds or CI infrastructure.Issues and PRs related to Node.js builds or CI infrastructure.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Activity
[-]Node.lib fails to link[/-][+]Node.exe fails to link[/+]Derailedzack commentedon Nov 8, 2021
Should I try building it in visual studio 2019? Later today I'm going to try building it on Ubuntu.
Trott commentedon Nov 9, 2021
@nodejs/platform-windows
Derailedzack commentedon Nov 21, 2021
Do I have to be a member to use that?
Trott commentedon Nov 21, 2021
Are you referring to
@nodejs/platform-windows. That was me pinging the folks on the project who are Windows folks. (I do believe you need to be able to be a member to ping folks like that, but I'm not 100% sure.)Trott commentedon Nov 21, 2021
@nodejs/build
Trott commentedon Nov 21, 2021
I don't know if this is the source of your problem or not, but https://github.com/nodejs/node/blob/40ab2888f57d11bda4820f871836118d8fec4d22/BUILDING.md#windows says that building on Windows requires Python 3.9, but your output above indicates you are running Python 3.6.
Derailedzack commentedon Nov 23, 2021
No that doesn't change anything
gireeshpunathil commentedon Nov 23, 2021
@Derailedzack - where is
zlib1.dllcoming from? that is the one which causes the symbol duplication. Do you have another zlib library installed in your system, which comes in the link path by default?Derailedzack commentedon Nov 23, 2021
It might be coming from vcpkg
Derailedzack commentedon Nov 23, 2021
I have zlib installed in vcpkg
gireeshpunathil commentedon Nov 23, 2021
thanks. Is that an essential component of that installation? is there a way to
uninstallthat component selectively, for testing purpose?(if that works then our build scripts might need modification to either i) use the installed zlib, or override that with the one from node, if we are building in windows with the
vcpkg. )Derailedzack commentedon Nov 23, 2021
The linker errors are gone.
liudonghua123 commentedon Jan 11, 2024
I build on windows and I notice some warnings
The system cannot find the file specifiedin the last. But node binary is built successfully and located inout\Release\node.exe.liudonghua123 commentedon Jan 11, 2024
I found
The system cannot find the file specifiedmaybe come from this line of build script in the first build.This should always shown in CI environment due to clean build.
node/vcbuild.bat
Line 340 in d102d16
rd test in cmd:
Maybe append
>NUL 2>&1is a good idea to suppress the confusing error like message.