# Errors occured when I build OpenCV 4.6.0

**URL:** <https://forum.opencv.org/t/errors-occured-when-i-build-opencv-4-6-0/11421>\
**Category:** Uncategorized\
**Tags:** build, videoio\
**Created:** [December 26, 2022, 12:57am UTC](https://forum.opencv.org/t/errors-occured-when-i-build-opencv-4-6-0/11421 "2022-12-26T00:57:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wold9168](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/wold9168/32/6835_2.png) [@wold9168](https://forum.opencv.org/u/wold9168)\
**Post date:** [December 26, 2022, 12:57am UTC](https://forum.opencv.org/t/errors-occured-when-i-build-opencv-4-6-0/11421/1 "2022-12-26T00:57:09Z")

</div>

Arch Linux 64bit.  
Something went wrong when I build OpenCV 4.6.0.  
It seemed that the module _videoio_ wasn’t built successfully.  
I have no idea with the problem above.  
The output of console is here:  
[Configuration](https://gist.github.com/wold9168/4ef887143c219c37666648386ebbc172)  
[Building(Stderr first, and stdout followed)](https://gist.github.com/wold9168/6b1df12ac231ffa023aebbb239b637cd)  
The command I used to build is  
`env LC_ALL=C cmake --build . -j10 > ../cmakelog_build.txt 2> ../cmakelog_build_error.txt`

---

<div class="post-metadata">

**Author:** ![wold9168](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/wold9168/32/6835_2.png) [@wold9168](https://forum.opencv.org/u/wold9168)\
**Post date:** [December 26, 2022, 3:17am UTC](https://forum.opencv.org/t/errors-occured-when-i-build-opencv-4-6-0/11421/2 "2022-12-26T03:17:18Z")

</div>

I noticed that I can normally build the code of the repository I pulled from the GitHub directly, but the code I download from the release page still cannot be built. That doubts me a lot.  
So I use `diff` to compare the file `ffmpeg_codecs.hpp` in `modules/videoio/src`, and find that the problem above is fixed in [PR#22357](https://github.com/opencv/opencv/pull/22357).

My friends. If you face the same problem (compile errors come from `ffmpeg_codecs.hpp`) as mine, I think you can add `#include <libavcodec/version.h> `after the line 62 of `ffmpeg_codecs.hpp`. That works in my computer.

Sorry for my poor English.
