# link error. ld: library not found for -lITKVideoIO

**URL:** https://discourse.itk.org/t/link-error-ld-library-not-found-for-litkvideoio/3461
**Category:** Beginner Questions
**Tags:** cmake, itk-releases, simpleitk
**Created:** [September 14, 2020, 7:16am UTC](https://discourse.itk.org/t/link-error-ld-library-not-found-for-litkvideoio/3461 "2020-09-14T07:16:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kaiyan\_liu](https://discourse.itk.org/user_avatar/discourse.itk.org/kaiyan_liu/32/1687_2.png) [@kaiyan\_liu](https://discourse.itk.org/u/kaiyan_liu)
#### Post date: [September 14, 2020, 7:16am UTC](https://discourse.itk.org/t/link-error-ld-library-not-found-for-litkvideoio/3461/1 "2020-09-14T07:16:17Z")

</div>

I’m new here for ITK. And I have tried to install ITK-5.2.0  
My environment version is as follows : OS:macOS 10.15.6. CMake 3.17.3 Make 3.81 clang 6.0.0  
I try to compile and install ITK as the guidebook (ItkSoftwareGuide.pdf) said.  
and I wrote a program (hello world) like this

```cpp
#include "itkImage.h"
#include <iostream>
int main(){
    using ImageType = itk::Image<unsigned short , 3>;
    ImageType::Pointer image = ImageType::New();
    std::cout << "Hello" << std::end;
    return EXIT_SUCCESS;
}

```

and the CMakeLists.txt like this

```auto
cmake_minimum_required(VERSION 3.17)
project(HelloWorld)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
set(CMAKE_CXX_STANDARD 11)
add_executable(HelloWorld HelloWorld.cxx)
target_link_libraries(HelloWorld ${ITK_LIBRARIES})

```

it’s ok when I run “CMAKE”,but when run “MAKE” , I get an error “ld: library not found for -lITKVideoIO”  
I thought it may be that I didn’t compile ITK\_Module\_VideoIO , so I just run

cmake … -DModule\_VideoIO:BOOL=ON

it runs successfully. But the error still appears.  
I want to know how to fix it.

By the way, when I configure ITK(with terminal ccmake) , there is nothing about ITKGroup\_GroupName. I have set ITK\_BUILD\_DEFAULT\_\_MODULES=OFF and toggle to advanced mode, but nothing changes.

---

<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 14, 2020, 4:37pm UTC](https://discourse.itk.org/t/link-error-ld-library-not-found-for-litkvideoio/3461/2 "2020-09-14T16:37:00Z")

</div>

> [@kaiyan\_liu](#):
>
> ITK\_BUILD\_DEFAULT\_\_MODULES

It should be `ITK_BUILD_DEFAULT_MODULES`, with one underscore (`_`).

But the main problem seems to be that your ITK did not compile properly. After configuring it, you also need to compile it (run `make` or `ninja` step).
