# vtksys/Configure.hxx

**URL:** https://discourse.vtk.org/t/vtksys-configure-hxx/12495
**Category:** Support
**Tags:** code
**Created:** [October 17, 2023, 4:13am UTC](https://discourse.vtk.org/t/vtksys-configure-hxx/12495 "2023-10-17T04:13:38Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Massi](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/b9e5f3/32.png) [@Massi](https://discourse.vtk.org/u/Massi)
#### Post date: [October 17, 2023, 4:13am UTC](https://discourse.vtk.org/t/vtksys-configure-hxx/12495/1 "2023-10-17T04:13:38Z")

</div>

Hello,  
I’m creating a C++ application that can read images and display/render them.  
Adding the this header `#include <vtk-9.3/vtkImageReader2.h>` on one of my hpp file generates the following error:

```auto
/usr/local/include/vtk-9.3/vtksys/SystemTools.hxx:6:10: fatal error: vtksys/Configure.hxx: No such file or directory
    6 | #include <vtksys/Configure.hxx>

```

what is this Configure.hxx file? how to fix that?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [October 17, 2023, 11:44am UTC](https://discourse.vtk.org/t/vtksys-configure-hxx/12495/2 "2023-10-17T11:44:39Z")

</div>

You’re missing VTK’s include directories. You should have them set up via CMake and, failing that, your code needs to have `#include <vtkImageReader2.h>` and the `vtk-9.3` part provided via `-I`.

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [October 17, 2023, 4:57pm UTC](https://discourse.vtk.org/t/vtksys-configure-hxx/12495/3 "2023-10-17T16:57:32Z")

</div>

Provided that you are using `CMake`, you can do something along the lines of

```
cmake_minimum_required(VERSION 3.8)

project(YourProjectName
  LANGUAGES
  CXX)

find_package(VTK 9.3 REQUIRED COMPONENTS
  IOImage
  # other packages that you need
)
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE 
${VTK_LIBRARIES})

```

---

<div class="post-metadata">

### Author: ![Massi](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/b9e5f3/32.png) [@Massi](https://discourse.vtk.org/u/Massi)
#### Post date: [October 18, 2023, 4:08am UTC](https://discourse.vtk.org/t/vtksys-configure-hxx/12495/4 "2023-10-18T04:08:14Z")

</div>

Many thanks for your reply!

I’m completely lost now with VTK, I dont know what I’m missing here. I know in the past it was not easy to setup.  
I have built this time VTK8 instead of VTK9 for future dev with Qt library and I used CMake gui version.  
I’m developing on a Linux machine and I’m using vscode as IDE.  
I included all necessary headers, well part of them, in tasks.json file

```auto
				/* VTK includes */
				"--include-directory=/home/massilinux/VTK8/src/**",
				"--include-directory=/home/massilinux/VTK8/build/**",
                "--include-directory=/home/massilinux/VTK8/src/Interaction/Image",
                "--include-directory=/home/massilinux/VTK8/src/Rendering/Core",
                "--include-directory=/home/massilinux/VTK8/src/Common/ExecutionModel",
                "--include-directory=/home/massilinux/VTK8/src/IO/Image",
				"--include-directory=/home/massilinux/VTK8/src/Common/Core",
				"--include-directory=/home/massilinux/VTK8/build/Common/Core",
				"--include-directory=/home/massilinux/VTK8/build/IO/Image",
				"--include-directory=/home/massilinux/VTK8/build/Common/ExecutionModel",
				"--include-directory=/home/massilinux/VTK8/build/Interaction/Image",
				"--include-directory=/home/massilinux/VTK8/build/Rendering/Core",
				"--include-directory=/home/massilinux/VTK8/build/Filters/Core",
				"--include-directory=/home/massilinux/VTK8/build/Utilities/KWIML",
				"--include-directory=/home/massilinux/VTK8/src/Utilities/KWIML/vtkkwiml/include/kwiml",
				"--include-directory=/home/massilinux/VTK8/src/Utilities/KWIML/vtkkwiml/",

```

All these includes seems laborious and the compilation still complain about missing header such as:

```auto
/home/massilinux/VTK8/build/Utilities/KWIML/vtk_kwiml.h:19:10: fatal error: vtkkwiml/abi.h: No such file or directory
   19 | #include "vtkkwiml/abi.h"

```

I dont know why this header for reading just a PNG file. Any thoughts?

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [October 18, 2023, 4:51pm UTC](https://discourse.vtk.org/t/vtksys-configure-hxx/12495/5 "2023-10-18T16:51:14Z")

</div>

If I were you, I would simply clone the `ImageViewer` in the `Examples/GUI/Qt` directory. Check if this works with your `Qt` installation. The examples are self-contained and search for `VTK` and `Qt`. Remember that the `Qt` directory should be the `lib/cmake/vtk-8` folder of your `Qt` build or your `Qt` installation.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [October 20, 2023, 12:48pm UTC](https://discourse.vtk.org/t/vtksys-configure-hxx/12495/6 "2023-10-20T12:48:04Z")

</div>

I would also suggest that you install VTK before using it; you should only need a handful of include paths, not one per module.

> [@Massi](#):
>
> I dont know why this header for reading just a PNG file. Any thoughts?

KWIML is used to know what 64bit types (`long`, `long long`, `__int64`) are available.

---

<div class="post-metadata">

### Author: ![Massi](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/b9e5f3/32.png) [@Massi](https://discourse.vtk.org/u/Massi)
#### Post date: [October 23, 2023, 2:43am UTC](https://discourse.vtk.org/t/vtksys-configure-hxx/12495/8 "2023-10-23T02:43:46Z")

</div>

Thanks for your reply,  
This is my c\_cpp\_properties file

```auto
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
                "${workspaceFolder}/*",
                "/home/massilinux/VTK8/include/**",
                "/usr/local/Qt-5.15.2/include/**",
                "/usr/local/Qt-5.15.2/lib/**"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "linux-clang-x64"
        }
    ],
    "version": 4
}

```

Is it enough ? because I’m still getting this error now:

```auto
/home/massilinux/Desktop/Project/ImageReader/ImageRead.hpp:18:10: fatal error: vtkImageReader2.h: No such file or directory
   18 | #include <vtkImageReader2.h>

```

here is my code where the error occurs

```auto
/// @headerfile External headers
#include <vtkImageReader2.h>

/// @brief 
namespace IMG
{
/// @brief 
/// @tparam T 
template < typename T = vtkImageReader2 >
class ImageRead : public IReader
{
public:
    /// @brief 
    ImageRead();
    /// @brief 
    ~ImageRead() = default;
    /// @brief 
    /// @param filepath 
    /// @return 
    auto setFileName(const char * filepath) -> void override;
    /// @brief 
    auto display() -> void override;
    /// @brief 
    /// @return 
    vtkAlgorithmOutput *getOutput() const override;
private:
    std::unique_ptr<T> mptr {nullptr};
};
} // namespace IMG

```

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [October 23, 2023, 7:08pm UTC](https://discourse.vtk.org/t/vtksys-configure-hxx/12495/9 "2023-10-23T19:08:58Z")

</div>

It’ll fail if `vtkImageReader2`’s module is not enabled (`IO/Image`).

---

<div class="post-metadata">

### Author: ![Jens\_Munk\_Hansen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jens_munk_hansen/32/1215_2.png) [@Jens\_Munk\_Hansen](https://discourse.vtk.org/u/Jens_Munk_Hansen)
#### Post date: [October 23, 2023, 8:17pm UTC](https://discourse.vtk.org/t/vtksys-configure-hxx/12495/10 "2023-10-23T20:17:16Z")

</div>

I would really suggest that you use CMake. It will add the necessary include directories (they are many) both for VTK and Qt.
