# how to use ITK in my own project in visual studio

**URL:** https://discourse.itk.org/t/how-to-use-itk-in-my-own-project-in-visual-studio/1805
**Category:** Beginner Questions
**Created:** [April 21, 2019, 12:39pm UTC](https://discourse.itk.org/t/how-to-use-itk-in-my-own-project-in-visual-studio/1805 "2019-04-21T12:39:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![maioda](https://discourse.itk.org/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@maioda](https://discourse.itk.org/u/maioda)
#### Post date: [April 21, 2019, 12:39pm UTC](https://discourse.itk.org/t/how-to-use-itk-in-my-own-project-in-visual-studio/1805/1 "2019-04-21T12:39:33Z")

</div>

hi , i’m new in ITK  
trying to include ITK in my own project in visual studio 2017  
by doing :  
1-project-\>properties-\>c/c+±\>general-\>Additional Include  
2-project-\>properties-\>Linker-\>general-\>Additional Library  
3–project-\>properties-\>Linker-\>Input -\> /lib\*.lib  
and i did these steps in both debug and release modes …then i tried to run simple program …and this error shows up 🙃

 ![Capture](https://discourse.itk.org/uploads/default/original/1X/2d428a5545922aa12499637feaafa11fcbbd3fa0.png)

Severity Code Description Project File Line Suppression State  
Error C4996 ‘std::copy::\_Unchecked\_iterators::\_Deprecate’: Call to ‘std::copy’ with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D\_SCL\_SECURE\_NO\_WARNINGS. See documentation on how to use Visual C++ ‘Checked Iterators’ Prostate c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.13.26128\include\xutility 2440

my code :

#include  
#include “itkImage.h”  
using namespace std;  
int main()  
{

```
typedef itk::Image< unsigned short, 3 > ImageType;
ImageType::Pointer image = ImageType::New();
std::cout << "ITK Hello World !" << std::endl;
return 0;

```

}

---

<div class="post-metadata">

### Author: ![Niels\_Dekker](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/9d8465/32.png) [@Niels\_Dekker](https://discourse.itk.org/u/Niels_Dekker)
#### Post date: [April 22, 2019, 12:07pm UTC](https://discourse.itk.org/t/how-to-use-itk-in-my-own-project-in-visual-studio/1805/2 "2019-04-22T12:07:36Z")

</div>

> [@maioda](#):
>
> Error C4996 ‘std::copy::\_Unchecked\_iterators::\_Deprecate’: Call to ‘std::copy’ with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D\_SCL\_SECURE\_NO\_WARNINGS. See documentation on how to use Visual C++ ‘Checked Iterators’ Prostate c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.13.26128\include\xutility 2440

I haven’t yet been able to reproduce this issue, but I’m afraid this kind of warning cannot be entirely avoided. However, it can be suppressed, in various ways:

- Switch off C/C++ → General → Treat Warnings As Errors
- Add `_SCL_SECURE_NO_WARNINGS` to C/C++ → Preprocessor Definitions
- Add `#pragma warning(disable: 4996)` to your cpp file (before doing the `#include` directives)

One of these should be sufficient to get your project building… right?

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [April 26, 2019, 6:32pm UTC](https://discourse.itk.org/t/how-to-use-itk-in-my-own-project-in-visual-studio/1805/3 "2019-04-26T18:32:35Z")

</div>

@maioda it is recommended to configure your project with CMake. This helps populate the required build settings in the Visual Studio project file.
