# It can work without include\_directories( ${OpenCV\_INCLUDE\_DIRS} )?

**URL:** <https://forum.opencv.org/t/it-can-work-without-include-directories-opencv-include-dirs/18740>\
**Category:** C++\
**Tags:** build, cmake\
**Created:** [September 13, 2024, 1:31am UTC](https://forum.opencv.org/t/it-can-work-without-include-directories-opencv-include-dirs/18740 "2024-09-13T01:31:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sea\_Sea](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/sea_sea/32/11091_2.png) [@Sea\_Sea](https://forum.opencv.org/u/Sea_Sea)\
**Post date:** [September 13, 2024, 1:31am UTC](https://forum.opencv.org/t/it-can-work-without-include-directories-opencv-include-dirs/18740/1 "2024-09-13T01:31:12Z")

</div>

I comment `include_directories` and it also can work.  
why?

[https://docs.opencv.org/4.x/db/df5/tutorial\_linux\_gcc\_cmake.html](https://docs.opencv.org/4.x/db/df5/tutorial_linux_gcc_cmake.html)

```auto
cmake_minimum_required(VERSION 2.8)
project( DisplayImage )
find_package( OpenCV REQUIRED )
# include_directories( ${OpenCV_INCLUDE_DIRS} )
add_executable( DisplayImage DisplayImage.cpp )
target_link_libraries( DisplayImage ${OpenCV_LIBS} )

```
