# Build Error: LNK1169 when building ITK with RTK Python wrappers on Windows

**URL:** https://discourse.itk.org/t/build-error-lnk1169-when-building-itk-with-rtk-python-wrappers-on-windows/7635
**Category:** Engineering
**Tags:** itk, python, cuda, cmake
**Created:** [September 19, 2025, 12:46pm UTC](https://discourse.itk.org/t/build-error-lnk1169-when-building-itk-with-rtk-python-wrappers-on-windows/7635 "2025-09-19T12:46:27Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![gaoweilin](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/f14d63/32.png) [@gaoweilin](https://discourse.itk.org/u/gaoweilin)
#### Post date: [September 19, 2025, 12:46pm UTC](https://discourse.itk.org/t/build-error-lnk1169-when-building-itk-with-rtk-python-wrappers-on-windows/7635/1 "2025-09-19T12:46:27Z")

</div>

I am encountering a linker error (LNK1169) while trying to build the ITK Python wrappers for the Reconstruction Toolkit (RTK). The build fails to generate the `itk_RTKPython.pyd` file. I have tried several common troubleshooting steps, but the issue persists. I would greatly appreciate any guidance.

### **1. Environment Information**

- **Operating System:** Windows 11

- **Compiler:** Visual Studio 2022 (MSVC)

- **Architecture:** x64

- **CMake Version:** 4.1.1

- **Python Version:** 3.11 (x64)

- **ITK Version:** v5.4.3 (built from source)

- **RTK Version:** Enabled `Module_RTK` within ITK, using version v2.7.0

### **2. Build Steps**

I roughly followed this build process:

1. Used CMake-GUI to configure and generate the ITK solution. I enabled the `ITK_WRAP_PYTHON` option.

2. Set `CMAKE_INSTALL_PREFIX` to `C:\Reconstraction\ITK\Bin`.

3. Enabled the following CMake options: `BUILD_SHARED_LIBS`, `ITKReview`, `ITK_USE_FFTWD`, `ITK_USE_FFTWF`, `ITK_USE_SYSTEM_FFTWD`, `ITK_USE_SYSTEM_FFTWF` (and specified the paths to my FFTW installation). I also enabled `Module_cudacommon`.

4. Opened the solution in Visual Studio 2022 and attempted to build the `ALL_BUILD` target in `Release` mode.  
The build fails with **68 errors** , primarily related to `LNK1169`.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [September 19, 2025, 12:47pm UTC](https://discourse.itk.org/t/build-error-lnk1169-when-building-itk-with-rtk-python-wrappers-on-windows/7635/2 "2025-09-19T12:47:04Z")

</div>

@simon.rit might want to comment.

---

<div class="post-metadata">

### Author: ![gaoweilin](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/f14d63/32.png) [@gaoweilin](https://discourse.itk.org/u/gaoweilin)
#### Post date: [September 19, 2025, 3:22pm UTC](https://discourse.itk.org/t/build-error-lnk1169-when-building-itk-with-rtk-python-wrappers-on-windows/7635/3 "2025-09-19T15:22:10Z")

</div>

new error  
LNK2005 "public: class std::vector\<class itk::Matrix\<double,3,4\>,class std::allocator\<class itk::Matrix\<double,3,4\> \> \> const & \_\_cdecl rtk::ProjectionGeometry\<3\>::GetMatrices(void)const " (?GetMatrices@?$ProjectionGeometry@$02@rtk@@QEBAAEBV?$vector@V?$Matrix@N$02$03@itk@@V?$allocator@V?$Matrix@N$02$03@itk@@@std@@@std@@XZ) 已经在 rtkProjectionGeometryPython.obj 中定义 RTKPython C:\Reconstraction\ITK\Build\Wrapping\Modules\RTK\itkRTK-5.4.lib(itkRTK-5.4.dll) 1 我想在帖子中询问这个错误

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [September 20, 2025, 11:49am UTC](https://discourse.itk.org/t/build-error-lnk1169-when-building-itk-with-rtk-python-wrappers-on-windows/7635/4 "2025-09-20T11:49:48Z")

</div>

Please describe how one can reproduce this “new error”.

---

<div class="post-metadata">

### Author: ![gaoweilin](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/f14d63/32.png) [@gaoweilin](https://discourse.itk.org/u/gaoweilin)
#### Post date: [September 20, 2025, 12:50pm UTC](https://discourse.itk.org/t/build-error-lnk1169-when-building-itk-with-rtk-python-wrappers-on-windows/7635/5 "2025-09-20T12:50:45Z")

</div>

1. Used CMake-GUI to configure and generate the ITK solution. I enabled the `ITK_WRAP_PYTHON` option.

2. Set `CMAKE_INSTALL_PREFIX` to `C:\Reconstraction\ITK\Bin`.

Enabled the following CMake options: `BUILD_SHARED_LIBS`, `ITKReview`, `ITK_USE_FFTWD`, `ITK_USE_FFTWF`, `ITK_USE_SYSTEM_FFTWD`, `ITK_USE_SYSTEM_FFTWF` (and specified the paths to my FFTW installation). I also enabled `Module_cudacommon`.

Then, I used VS2022 to build the `ALL_BUILD` target in Release mode, and the following error occurs，These errors occur simultaneously：

```auto
Creating library C:/Reconstraction/ITK/Build/lib/Release/RTKPython.lib and object C:/Reconstraction/ITK/Build/lib/Release/RTKPython.exp
C:\Reconstraction\ITK\Build\Wrapping\Generators\Python\itk\_RTKPython.pyd : fatal error LNK1169: one or more multiply defined symbols found
Build of project “RTKPython.vcxproj” completed – FAILED.   

```

---

<div class="post-metadata">

### Author: ![gaoweilin](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/f14d63/32.png) [@gaoweilin](https://discourse.itk.org/u/gaoweilin)
#### Post date: [September 20, 2025, 2:32pm UTC](https://discourse.itk.org/t/build-error-lnk1169-when-building-itk-with-rtk-python-wrappers-on-windows/7635/6 "2025-09-20T14:32:05Z")

</div>

I want to use the Python version of RTK with CUDA acceleration. I downloaded it using `python -m pip install itk-rtk-cuda124`, but my tests kept throwing errors, so I tried compiling ITK and RTK instead…

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [September 20, 2025, 2:39pm UTC](https://discourse.itk.org/t/build-error-lnk1169-when-building-itk-with-rtk-python-wrappers-on-windows/7635/7 "2025-09-20T14:39:32Z")

</div>

What are the errors? It’s the same code so I doubt that there will be any difference.

---

<div class="post-metadata">

### Author: ![gaoweilin](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/f14d63/32.png) [@gaoweilin](https://discourse.itk.org/u/gaoweilin)
#### Post date: [September 20, 2025, 3:03pm UTC](https://discourse.itk.org/t/build-error-lnk1169-when-building-itk-with-rtk-python-wrappers-on-windows/7635/8 "2025-09-20T15:03:15Z")

</div>

(PyCharmMiscProject) PS C:\Users\lianglab\PyCharmMiscProject\> python FirstReconstruction.py output.mha geometry.xml  
Traceback (most recent call last):  
File “C:\Users\lianglab\PyCharmMiscProject\FirstReconstruction.py”, line 11, in  
ImageType = itk.Image[itk.F, 3]  
^^^^^^^^^  
File “C:\Reconstraction\ITK\Build\Wrapping\Generators\Python\itk\support\lazy.py”, line 138, in **getattribute**  
base.itk\_load\_swig\_module(module, namespace)  
File “C:\Reconstraction\ITK\Build\Wrapping\Generators\Python\itk\support\base.py”, line 94, in itk\_load\_swig\_module  
itk\_load\_swig\_module(dep, namespace)  
File “C:\Reconstraction\ITK\Build\Wrapping\Generators\Python\itk\support\base.py”, line 130, in itk\_load\_swig\_module  
l\_module = loader.load(swig\_module\_name)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Reconstraction\ITK\Build\Wrapping\Generators\Python\itk\support\base.py”, line 289, in load  
l\_spec.loader.exec\_module(l\_module) # pytype: disable=attribute-error  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “”, line 940, in exec\_module  
File “”, line 241, in \_call\_with\_frames\_removed  
File “C:\Reconstraction\ITK\Build\Wrapping\Generators\Python\itk\support..\ITKPyBasePython.py”, line 63, in  
from itk.pyBasePython import \*  
File “C:\Reconstraction\ITK\Build\Wrapping\Generators\Python\itk\pyBasePython.py”, line 15, in  
from . import \_ITKCommonPython  
ImportError: cannot import name '_ITKCommonPython’ from ‘itk’ (C:\Reconstraction\ITK\Build\Wrapping\Generators\Python\itk\_init_.py)

---

<div class="post-metadata">

### Author: ![gaoweilin](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/f14d63/32.png) [@gaoweilin](https://discourse.itk.org/u/gaoweilin)
#### Post date: [September 20, 2025, 3:04pm UTC](https://discourse.itk.org/t/build-error-lnk1169-when-building-itk-with-rtk-python-wrappers-on-windows/7635/9 "2025-09-20T15:04:34Z")

</div>

This is the result of running the First Reconstruction example from RTK.

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [September 21, 2025, 8:04pm UTC](https://discourse.itk.org/t/build-error-lnk1169-when-building-itk-with-rtk-python-wrappers-on-windows/7635/10 "2025-09-21T20:04:03Z")

</div>

It seems to have trouble loading the package which might be due to missing libraries. Since you’re using the Cuda package, can you try adding the two lines in [CudaFirstReconstruction.py](https://github.com/RTKConsortium/RTK/blob/main/examples/FirstReconstruction/FirstCudaReconstruction.py) before line 11?

```auto
if sys.platform == "win32":
    os.add_dll_directory(os.path.join(os.environ["CUDA_PATH"], "bin"))

```

Have you tried the Cuda example?
