opencv headers and errors from example files

I’m confused . I installed everything according to the instructions supplied and I cant run opencv examples at all.I get some weird errors about missing headers and especially highgui errors like this one:
I tried following the CudaCasts and run the bgfg example but i cant follow the instructions because the example files that he used were different than those i downloaded.
Don’t get me wrong,I have CUDA and OpenCV4Tegra installed and some functions are able to run.I also checked the pkg-config paths and it looks OK(although i am not sure why the opencv is included but not opencv2 and still some programs that use opencv2 headers are still working).
I think it might be because of new releases for opencv4tegra and maybe the CUDA.
what can I do to fix those problems?
BTW no examples were provided with the opencv4Tegra so i downloaded them from github.

It seems that OpenCV4Tegra does not include the VideoIO features.

As indicated below, cf. “Known Issues”:

You can use V4L2 api directly.

Hi jc84,

If OpenCV4Tegra does not support VideoIO features, does this mean that uninstalling openCV4Tegra and installing openCV would fix this problem?

Thanks a lot


Yes, that did the trick.

I just uninstalled openCV4Tegra and installed openCV 2.4.9 following this link (there are several important tweaks):

Now my camera is working and I can read frames with cv2 from python