isl-org / isl-org/Open3D

Cannot install C++ on Windows 11 (fatal error LNK1169 on ext_zlib)

Open
#6,134 1 comment 0 reactions 0 assignees View on GitHub
build/install
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

### Checklist

- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).

### Steps to reproduce the issue

Hello,

I've tried to install C++ Open3D on my Windows 11 PC, to get the .dll-file for further usage. When trying the ALL_BUILD cmake, it fails because of the attached LNK2005 error, that says that multiple things like "inflate" or "crc32" are already defined. Therefore I also cannot execute the INSTALL command. So far, I've tried multiple different cmake arguments, but nothing has changed this error.

Other things I've tried:
* building in the command line or building in Visual Studio (2019 and 2022)
* using the asset from the github release. But there are multiple files missing, e.g. the surface reconstruction, which are the main part that i want to use from Open3D.
* The provided links in the documentation (http://www.open3d.org/docs/release/getting_started.html#c) do not work for Windows as the files are not available
* https://github.com/isl-org/Open3D/issues/5608: describes a similar exception, but I don't really understand the proposed solution, because when I open the Visual Studio solution, I cannot find the shown dialog from the screenshot

Is there another easier way, to get the complete Open3D-dll including e.g. the surface reconstruction to use it further in C++ code?

Thank you for your help :)

### Error message

```shell
Performing build step for 'ext_zlib'
MSBuild version 17.5.1+f6fdcf537 for .NET Framework

zlib.lib(zlib1.dll) : error LNK2005: inflate ist bereits in inflate.obj definiert. [C:\src\Open3D-0.17.0\build\zlib\src
\ext_zlib-build\zlib.vcxproj] [C:\src\Open3D-0.17.0\build\ext_zlib.vcxproj]
zlib.lib(zlib1.dll) : error LNK2005: inflateEnd ist bereits in inflate.obj definiert. [C:\src\Open3D-0.17.0\build\zlib\
src\ext_zlib-build\zlib.vcxproj] [C:\src\Open3D-0.17.0\build\ext_zlib.vcxproj]
zlib.lib(zlib1.dll) : error LNK2005: crc32 ist bereits in crc32.obj definiert. [C:\src\Open3D-0.17.0\build\zlib\src\ext
_zlib-build\zlib.vcxproj] [C:\src\Open3D-0.17.0\build\ext_zlib.vcxproj]
zlib.lib(zlib1.dll) : error LNK2005: inflateInit2_ ist bereits in inflate.obj definiert. [C:\src\Open3D-0.17.0\build\zl
ib\src\ext_zlib-build\zlib.vcxproj] [C:\src\Open3D-0.17.0\build\ext_zlib.vcxproj]
zlib.lib(zlib1.dll) : error LNK2005: get_crc_table ist bereits in crc32.obj definiert. [C:\src\Open3D-0.17.0\build\zlib
\src\ext_zlib-build\zlib.vcxproj] [C:\src\Open3D-0.17.0\build\ext_zlib.vcxproj]
Bibliothek "C:/src/Open3D-0.17.0/build/zlib/src/ext_zlib-build/Release/zlib.lib" und Objekt "C:/src/Open3D-0.17.
0/build/zlib/src/ext_zlib-build/Release/zlib.exp" werden erstellt.
C:\src\Open3D-0.17.0\build\zlib\src\ext_zlib-build\Release\zlib.dll : fatal error LNK1169: Mindestens ein mehrfach defi
niertes Symbol gefunden. [C:\src\Open3D-0.17.0\build\zlib\src\ext_zlib-build\zlib.vcxproj] [C:\src\Open3D-0.17.0\build\
ext_zlib.vcxproj]
zlibstatic.vcxproj -> C:\src\Open3D-0.17.0\build\zlib\src\ext_zlib-build\Release\zlibstatic.lib
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5):
error MSB8066: Der benutzerdefinierte Build für "C:\src\Open3D-0.17.0\build\CMakeFiles\ea09ec484f8018e00fb9e6f18007f029
\ext_zlib-build.rule;C:\src\Open3D-0.17.0\build\CMakeFiles\ea09ec484f8018e00fb9e6f18007f029\ext_zlib-install.rule;C:\sr
c\Open3D-0.17.0\build\CMakeFiles\ec2248c979cc19bb9b7b133efeefa075\ext_zlib-complete.rule;C:\src\Open3D-0.17.0\build\CMa
keFiles\f2f41ea2859b820aa9e84ad32f00e71c\ext_zlib.rule" wurde mit dem Code 1 beendet. [C:\src\Open3D-0.17.0\build\ext_z
lib.vcxproj]
```

### Open3D, Python and System information

```markdown
- Operating system: Windows 11 64-bit
- Python version: Python 3.11 (I've also tried with 3.10., but it made no difference)
- Open3D version: master-build (0.17.0)
- System architecture: x64
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): gcc 7.5 / clang 7.0
```

### Additional information

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the Windows build in the generated ext_zlib and zlib.vcxproj targets, using the reported LNK2005/LNK1169 output as the failure point. Review the CMake build configuration and the Windows installation documentation, including issue #5608, then verify that ALL_BUILD and INSTALL produce a complete Open3D DLL with the requested surface-reconstruction components.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.