Skip to content

Multiply defined symbol errors in libuv.lib and openssl.lib because of node.lib #1656

@DragonOsman

Description

@DragonOsman
  • Node.js Version: v11.3.0
  • OS: Windows 10 Home
  • Scope (install, code, runtime, meta, other?): other (building)
  • Module (and version) (if relevant): N/A

I ran vcbuild with this command to generate project files: .\vcbuild release x64 noetw nobuild. Then I opened up Visual Studio, set the include file and library search paths--as well as changing the name of the input file to the linker to zlib.lib (and adding zlibstatic.lib in node.vcxproj)--in all the projects that have options for that, and then tried to build node_lib.vcxproj first which succeeded (I did this because the library files that were generated when I built zlib were zlib.lib and zlibstatic.lib; no z.lib). But building node.vcxproj failed with these errors:

38>libuv.lib(zlib.dll) : error LNK2005: �zlib_NULL_THUNK_DATA already defined in node.lib(zlib.dll)
38>libuv.lib(zlib.dll) : error LNK2005: __NULL_IMPORT_DESCRIPTOR already defined in node.lib(zlib.dll)
38>libuv.lib(zlib.dll) : error LNK2005: __IMPORT_DESCRIPTOR_zlib already defined in node.lib(zlib.dll)
38>openssl.lib(zlib.dll) : error LNK2005: �zlib_NULL_THUNK_DATA already defined in node.lib(zlib.dll)
38>openssl.lib(zlib.dll) : error LNK2005: __NULL_IMPORT_DESCRIPTOR already defined in node.lib(zlib.dll)
38>openssl.lib(zlib.dll) : error LNK2005: __IMPORT_DESCRIPTOR_zlib already defined in node.lib(zlib.dll)
38>C:\node\Release\node.exe : fatal error LNK1169: one or more multiply defined symbols found

And there's also this linker warning:

LIBCMT.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library

Someone please help me out here. Thanks in advance. [Note: I closed the other issues about this because they were either not needed anymore or I'd already partially solved them at least.]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions