# Problem compiling project: error ld with -lproxTV

**URL:** <https://discourse.itk.org/t/problem-compiling-project-error-ld-with-lproxtv/3711>\
**Category:** Engineering\
**Tags:** ld, proxtv\
**Created:** [December 17, 2020, 10:32am UTC](https://discourse.itk.org/t/problem-compiling-project-error-ld-with-lproxtv/3711 "2020-12-17T10:32:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![fonsocm](https://discourse.itk.org/letter_avatar_proxy/v4/letter/f/ee7513/32.png) [@fonsocm](https://discourse.itk.org/u/fonsocm)\
**Post date:** [December 17, 2020, 10:32am UTC](https://discourse.itk.org/t/problem-compiling-project-error-ld-with-lproxtv/3711/1 "2020-12-17T10:32:12Z")

</div>

Hi.

I am compiling a project with ITK 5.1.2 over KDE Neon (based on Ubuntu 20.04 LTS) and I obtain the error: /usr/bin/ld: cannot find -lproxTV. However, if I go to ./itk/lib there is libitkproxTV-5.1.a. And ITK compiled without problem (some warning).

I tried to compile ITK with gcc (9.3.0) and clang (10.0.1) but it shows the same error. I have defined in my .profile:

export VTK\_DIR=/opt/vtk/lib/cmake/vtk-9.0  
export ITK\_DIR=/opt/itk/lib/cmake/ITK-5.1

Can someone help me?

Many thanks.

---

<div class="post-metadata">

**Author:** ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)\
**Post date:** [December 17, 2020, 11:38am UTC](https://discourse.itk.org/t/problem-compiling-project-error-ld-with-lproxtv/3711/2 "2020-12-17T11:38:57Z")

</div>

Are you enabling `Module_TotalVariation:BOOL=ON` when you compile ITK?  
proxTV is fetched when using the TotalVariation module: [https://github.com/InsightSoftwareConsortium/ITKTotalVariation](https://github.com/InsightSoftwareConsortium/ITKTotalVariation)

---

<div class="post-metadata">

**Author:** ![fonsocm](https://discourse.itk.org/letter_avatar_proxy/v4/letter/f/ee7513/32.png) [@fonsocm](https://discourse.itk.org/u/fonsocm)\
**Post date:** [December 17, 2020, 12:40pm UTC](https://discourse.itk.org/t/problem-compiling-project-error-ld-with-lproxtv/3711/3 "2020-12-17T12:40:22Z")

</div>

Yes.

And I have USE\_SYSTEM\_PROXTV to off.

---

<div class="post-metadata">

**Author:** ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)\
**Post date:** [December 17, 2020, 1:53pm UTC](https://discourse.itk.org/t/problem-compiling-project-error-ld-with-lproxtv/3711/4 "2020-12-17T13:53:52Z")

</div>

I cannot reproduce using itk master, and a external example requiring ITK TotalVaration module.  
The library associated with the target `proxTV::proxTV` is indeed `libitkproxTV` (no `-lproxTV`).

- Was this working before and now failing with that release, or is it a new project?
- In your project, do you have any logic specific to the library `proxTV`?
- Have you tried a clean build of your project?

---

<div class="post-metadata">

**Author:** ![fonsocm](https://discourse.itk.org/letter_avatar_proxy/v4/letter/f/ee7513/32.png) [@fonsocm](https://discourse.itk.org/u/fonsocm)\
**Post date:** [December 18, 2020, 6:09pm UTC](https://discourse.itk.org/t/problem-compiling-project-error-ld-with-lproxtv/3711/5 "2020-12-18T18:09:58Z")

</div>

- It is a project in ITK v4 we are translating to ITK v5? In ITK v4, it worked without problem.

- No. The only “special” logic we have in the project it is the use of: itkConnectedRegionEdgeThresholdImageFilter (from David Doria): [https://github.com/daviddoria/itkConnectedRegionEdgeThresholdImageFilter](https://github.com/daviddoria/itkConnectedRegionEdgeThresholdImageFilter).

- Yes and the error persists.

---

<div class="post-metadata">

**Author:** ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)\
**Post date:** [December 18, 2020, 6:30pm UTC](https://discourse.itk.org/t/problem-compiling-project-error-ld-with-lproxtv/3711/6 "2020-12-18T18:30:00Z")

</div>

Running out of ideas, but I suspect that if it is asking for `-lproxTV` is because an option in the CACHE is set to use the system `proxTV` (instead of the internal `libitkproxTV`).

Double checking, the option is named: `ITK_USE_SYSTEM_proxTV`, not `USE_SYSTEM_PROXTV ` as you reported. Try setting `ITK_USE_SYSTEM_proxTV` to OFF.

---

<div class="post-metadata">

**Author:** ![fonsocm](https://discourse.itk.org/letter_avatar_proxy/v4/letter/f/ee7513/32.png) [@fonsocm](https://discourse.itk.org/u/fonsocm)\
**Post date:** [January 28, 2021, 8:34pm UTC](https://discourse.itk.org/t/problem-compiling-project-error-ld-with-lproxtv/3711/7 "2021-01-28T20:34:41Z")

</div>

Hi.

I think there is a bug in ITK 5.1. I installed in a virtual machine Manjaro (it is stable and popular) in order to test if could be because “some” configuration in KDE Neon, moreover, it is based in Arch, not Ubuntu.

I used the KDE version and I compiled from source ITK 5.1.2 without problem using gcc 10.2.0 and cmake 3.19.3. I obtained some warnings but no errors.

 ![itk_config](https://discourse.itk.org/uploads/default/original/2X/8/8db80d683e5a36a366abc286a813191c7836be0d.png)

I compiled the Hello\_Word project from ITK Software Guide and I obtained the same error:

```
[50%] Linking CXX executable HelloWorld
/usr/bin/ld: cannot find -lproxTV
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/HelloWorld.dir/build.make:349: HelloWorld] Error 1
make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/HelloWorld.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

```

The CMakeLists.txt is:

```
project(HelloWorld)

cmake_minimum_required(VERSION 3.19)

if(COMMAND cmake_policy)
      cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

find_package(ITK REQUIRED)

include(${ITK_USE_FILE})

add_executable(HelloWorld HelloWorld.cxx)

target_link_libraries(HelloWorld ${ITK_LIBRARIES})
```

---

<div class="post-metadata">

**Author:** ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)\
**Post date:** [January 28, 2021, 10:48pm UTC](https://discourse.itk.org/t/problem-compiling-project-error-ld-with-lproxtv/3711/8 "2021-01-28T22:48:07Z")

</div>

I am sorry I cannot reproduce in Archlinux, gcc-10.2, cmake-3.19.2

Tested with ITK release branch.

```bash
cd /path//itk-src; git checkout release
cd /path/itk-build
cmake -G Ninja /path/itk-src -DModule_TotalVariation:BOOL=ON

```

ITK compiles successfully with some warnings.

Then I compile whatever hello world example, and it links ok.

I am wondering if you are using an old SHA for the module.

Open your `/path/itk-build/CMakeCache.txt`  
And delete the option `Module_TotalVariation_GIT_TAG`:

```auto
//Override default GIT_TAG value for remote module TotalVariation
Module_TotalVariation_GIT_TAG:STRING=e47fb5b1e2eef32cddb131d8ba47b78dbde9fbbd

```

Then, re-configure and re-build ITK, and do the same with your HelloWorld project that links to that freshly built ITK with `-DITK_DIR=/path/itk-build`.

EDIT: To check the current SHA for the module see [Update remote module in ITK](https://discourse.itk.org/t/update-remote-module-in-itk/2615/7)
