# OpenCV 4.x+ plus VS 2012 error - requires enabled C++11 support

**URL:** <https://forum.opencv.org/t/opencv-4-x-plus-vs-2012-error-requires-enabled-c-11-support/4427>\
**Category:** C++\
**Tags:** build\
**Created:** [July 22, 2021, 2:53pm UTC](https://forum.opencv.org/t/opencv-4-x-plus-vs-2012-error-requires-enabled-c-11-support/4427 "2021-07-22T14:53:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![inga.shell](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@inga.shell](https://forum.opencv.org/u/inga.shell)\
**Post date:** [July 22, 2021, 2:53pm UTC](https://forum.opencv.org/t/opencv-4-x-plus-vs-2012-error-requires-enabled-c-11-support/4427/1 "2021-07-22T14:53:54Z")

</div>

Hello. I used this tutorial - Installation by Making Your Own Libraries from the Source Files - [OpenCV: Installation in Windows](https://docs.opencv.org/4.5.2/d3/d52/tutorial_windows_install.html)  
to build a library OpenCV 4.5.2 for Visual Studio 2012  
During

> Go to the build directory and open the created **OpenCV** solution. Depending on just how much of the above options you have selected the solution may contain quite a lot of projects so be tolerant on the IDE at the startup. Now you need to build both the _Release_ and the _Debug_ binaries. Use the drop-down menu on your IDE to change to another of these after building for one of them.

I get the error C: \ lib2 \ opencv \ modules \ core \ include \ opencv2 / core / cvdef.h (736): fatal error C1189: #error: “OpenCV 4.x + requires enabled C ++ 11 support”

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [July 22, 2021, 6:01pm UTC](https://forum.opencv.org/t/opencv-4-x-plus-vs-2012-error-requires-enabled-c-11-support/4427/2 "2021-07-22T18:01:38Z")

</div>

I’d recommend upgrading Visual Studio in any case.

you could figure out whether C++11 is enabled in the VS project.

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [July 23, 2021, 7:37am UTC](https://forum.opencv.org/t/opencv-4-x-plus-vs-2012-error-requires-enabled-c-11-support/4427/3 "2021-07-23T07:37:28Z")

</div>

> [@inga.shell](#):
>
> I get the error C: \ lib2 \ opencv \ modules \ core \ include \ opencv2 / core / cvdef.h (736): fatal error C1189: #error: “OpenCV 4.x + requires enabled C ++ 11 support”

it is checking your c++ compiler / version, and tells us, your compiler wo’nt work with latest master branch.

you can try to:

- upate your VS
- fall back to the opencv 3.4 branch which does not rely so heavily on c++11 (`git checkout 3.4`)
