Encountered Error Compiling OpenCV 4.2.0 on Ubuntu 18.04: Unable to build target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' during make process

After following a tutorial at

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=OFF -D OPENCV_ENABLE_NONFREE=ON -D WITH_CUDA=ON -D WITH_CUDNN=ON -D OPENCV_DNN_CUDA=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D CUDA_ARCH_BIN=7.0 -D WITH_CUBLAS=1 -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -D HAVE_opencv_python3=ON -D PYTHON_EXECUTABLE=~/.virtualenvs/opencv_cuda/bin/python -D BUILD_EXAMPLES=ON ..

The build process was successful.

However, when trying to make the project with the command:

make -j6

There is an error reported:

modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:326: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_v4l.cpp.o' failed make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_v4l.cpp.o] Error 1 CMakeFiles/Makefile2:8448: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 Makefile:162: recipe for target 'all' failed

[ 19%] Built target ade
[ 19%] Built target opencv_videoio_plugins
[ 19%] Built target opencv_cudev
[ 22%] Built target opencv_core
[ 25%] Built target opencv_imgproc
[ 26%] Built target opencv_imgcodecs
[ 26%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_v4l.cpp.o
In file included from /home/cv001/opencv/modules/videoio/src/cap_v4l.cpp:240:0:
/usr/include/aarch64-linux-gnu/sys/videoio.h:71:22: error: redeclaration of ‘CV_CAP_ANY’
     CV_CAP_ANY      =0,     // autodetect
                      ^
In file included from /home/cv001/opencv/modules/videoio/src/precomp.hpp:46:0,
                 from /home/cv001/opencv/modules/videoio/src/cap_v4l.cpp:212:
/home/cv001/opencv/modules/videoio/include/opencv2/videoio/legacy/constants_c.h:10:5: note: previous declaration ‘<unnamed enum> CV_CAP_ANY’
     CV_CAP_ANY      =0,     // autodetect
     ^~~~~~~~~~
This series of errors continues on...

Answer №1

After completely deleting the opencv related file, the process now completes successfully. The reason behind this is still unknown.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Developing a personalized address field in Django Model

What is the standard method for storing postal addresses in Django models? Are there any specialized libraries available that offer custom model fields with built-in validation and formatting for postal address data? If no libraries are found, how can I c ...

Alert: The 'chromedriver' executable file must be located in the PATH directory. For further details, visit the link: https://sites.google.com/a/chromium.org/chromedriver/home

Throughout my experience, I have encountered this question multiple times and found effective solutions. Interestingly, I am able to execute the code flawlessly from the editor (VS Code). However, when I attempt to run it using a batch file (*.bat), an er ...

``Is there a way to retrieve the value of a Vue object with the help of Selenium WebDriver?

My HTML code snippet is as follows: <div data-v-58fe9fbf="" data-v-5de8f7f2="" class="copy-button" id="cta_get_link"> <input data-v-58fe9fbf="" type="text" readonly="readonly" c ...

Utilize Pandas to swap out a single value in a list for a string comprised of values from a

I have searched high and low, but I cannot seem to find a solution here or on Google. My goal is to replace a list of IDs within a cell with a comma-separated list of values from another DataFrame that contains the "Id" and "name" of each element. | id ...

Leveraging the power of boto3 to effortlessly retrieve files from Amazon EFS

I have been trying to download files from EFS by following this specific documentation: Even after thoroughly going through the entire documentation, I was unable to find a straightforward method for file downloads. The only potential solution seems to be ...

The page continues to load indefinitely even after executing the Python Selenium code

My code finishes running, but the page takes an extra 15 minutes to fully load. Is there a way to speed up this loading process? In a normal Chrome page, manually updating only takes seconds, but even using Automated Chrome is still very slow. Actual I& ...

The error "AttributeError: cannot modify attribute while adding a substring to elements in a list" is occurring

I need to append the chr prefix to each item in the clr_A0.chromnames list. import cooler import cooltools.lib.plotting import cooltools from pathlib import Path pathlist = Path(data_dir).glob('**/*.mcool') for path in pathlist: cool_ ...

The Selenium automation tool is experiencing longer page load times than the anticipated timeout duration

My goal is to have a maximum wait time of 15 seconds after calling the driver.get() method. The code I currently have set up looks like this: ... driver.set_page_load_timeout(15) try: driver.get(url) except TimeoutException as e: pass try: We ...

Dealing with the Stale Element Reference Exception in Selenium caused by element.click() operation

Error Output: An error occurred while using selenium: selenium.common.exceptions.StaleElementReferenceException: Message: The element reference of <span class="a-size-medium a-color-base a-text-normal"> is stale; either the element is no l ...

Extract only the numerical values directly preceded by the currency symbol £ by eliminating all other characters in the text

I am dealing with text that contains values like: this is a value £28.99 (0.28/ml) My goal is to extract just the price, so it should return: £28.99 The number of digits between the £ and . can vary. I believe that r"£[0-9]*\.[0-9]{2}" is t ...

Scrapy utilizes AJAX to send a request in order to receive the response of the dynamically generated

Is there a way to efficiently extract data from websites like this? To display all available offers, the "Show More Results" button at the bottom of the page needs to be clicked multiple times until all offers are shown. Each click triggers an AJAX reques ...

Identifying alterations in Python loops on the RaspberryPi

Currently, I am facing an issue with a Python program for RaspberryPi. The program involves a continuous loop that detects a change in one of the pins and then opens another pin along with requesting a URL. The functionality works fine but the problem is ...

SQLAlchemy: What is the best way to establish a default value for a column by using a reference to the same table that contains that column?

When working with SQLAlchemy, the question arises: how should a column's default value be defined using a reference to the table containing that column? Consider these tables as an example (SQLite): CREATE TABLE department ( id INTEGER PRIMARY KEY ...

Experiencing issues while setting up and using Selenium and Pycharm, encountering errors during

Upon installing Selenium, I ran a pip check for Selenium and encountered the following issues: qdarkstyle 2.8.1 requires helpdev which is not installed. Spyder 4.1.4 requires pyqt5<5.13 with python version >= "3", but you have pyqt5 ve ...

Tips for achieving a perfect score on my model's coverage tests

I have implemented coverage in my Django project, and the results are as follows: Name Stmts Miss Cover ---------------------------------------------------------------- test.apps.testapp.models.company ...

Incorporating a key to a Pandas DataFrame boxplot

I need to create a legend for a series of boxplots plotted on the same axes. My script is quite simple: import pandas as pd import matplotlib.pyplot as plt import numpy as np df={} bp={} positions = [1,2,3,4] df[0]= pd.DataFrame (np.random.rand(4,4),colum ...

What is the accurate Scrapy XPath for identifying <p> elements that are mistakenly nested within <h> tags?

I am currently in the process of setting up my initial Scrapy Spider, and I'm encountering some challenges with utilizing xpath to extract specific elements. My focus lies on (which is a Chinese website akin to Box Office Mojo). Extracting the Chine ...

MyPy encounters issue when handling dataclass argument containing an optional list of objects

I'm encountering issues with MyPy when trying to validate my code featuring a dataclass called Bar. This dataclass includes an optional argument foos which is intended to hold a list of Foo objects and has a default value of an empty list. To my surp ...

Is there a way for me to enable the functionality of the Edit button within a modal in order to update its

When I click the update button, my goal is to be able to edit the contents of the modal in the database. However, I am currently facing challenges with that process. The modal resides within my index.html file. Here are the details... Code from Modal and ...

Set up npm and nodejs in your environment by incorporating Laravel gulp

I am currently using Linux and attempting to work with gulp in Laravel 5.2. I have installed nodejs using the following command: sudo apt-get install nodejs Additionally, I have installed npm with the command: sudo apt-get install npm Although I have t ...