-
-
- Posts: 30
- Joined: 2024-01-23 2:55
I think I have followed all the instructions
here, but when I go to compile, I get:
Code: Select all
Consolidate compiler generated dependencies of target opencv-mobile-test
[ 50%] Building CXX object CMakeFiles/opencv-mobile-test.dir/main.cpp.o
/root/opencv-mobile-test/main.cpp: In function 'int main()':
/root/opencv-mobile-test/main.cpp:9:9: error: 'VideoCapture' is not a member of 'cv'
cv::VideoCapture cap;
^~~~~~~~~~~~
/root/opencv-mobile-test/main.cpp:10:5: error: 'cap' was not declared in this scope
cap.set(cv::CAP_PROP_FRAME_WIDTH, 320);
^~~
/root/opencv-mobile-test/main.cpp:10:17: error: 'CAP_PROP_FRAME_WIDTH' is not a member of 'cv'
cap.set(cv::CAP_PROP_FRAME_WIDTH, 320);
^~~~~~~~~~~~~~~~~~~~
/root/opencv-mobile-test/main.cpp:11:17: error: 'CAP_PROP_FRAME_HEIGHT' is not a member of 'cv'
cap.set(cv::CAP_PROP_FRAME_HEIGHT, 240);
^~~~~~~~~~~~~~~~~~~~~
/root/opencv-mobile-test/main.cpp:14:31: error: 'CAP_PROP_FRAME_WIDTH' is not a member of 'cv'
const int w = cap.get(cv::CAP_PROP_FRAME_WIDTH);
^~~~~~~~~~~~~~~~~~~~
/root/opencv-mobile-test/main.cpp:15:31: error: 'CAP_PROP_FRAME_HEIGHT' is not a member of 'cv'
const int h = cap.get(cv::CAP_PROP_FRAME_HEIGHT);
^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/opencv-mobile-test.dir/build.make:76: CMakeFiles/opencv-mobile-test.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/opencv-mobile-test.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
-
- Posts: 283
- Joined: 2024-01-08 10:59
Hello,
We are unable to reproduce this error message at the moment. Please try compiling with this package and see if the error persists.
-
- Posts: 30
- Joined: 2024-01-23 2:55
Cool! I was able to just run "opencv-mobile-test" directly from the build directory and it worked right away!
I'll try compiling it tomorrow.
-
- Posts: 30
- Joined: 2024-01-23 2:55
Trying to compile, I keep getting:
Code: Select all
CMake Error at CMakeLists.txt:9 (find_package):
By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCV", but
CMake did not find one.
Could not find a package configuration file provided by "OpenCV" with any
of the following names:
OpenCVConfig.cmake
opencv-config.cmake
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.
I'm not very good at all this CPP make stuff!

-
- Posts: 283
- Joined: 2024-01-08 10:59
Is there anything else to modify in CMakeLists.txt besides changing the cross-compiler path?
The normal compilation process is illustrated in the diagram below:
-
- Posts: 9
- Joined: 2024-01-27 6:36
我遇到了跟他一模样的问题。
我的文件夹内容见附件。
报错内容与命令行反馈也在附件中。
-
Attachments
-

-
Downloaded 439 times
-
- Posts: 9
- Joined: 2024-01-27 6:36
不过,我用你在这个贴子里上传的压缩包就好了。我的是luckfox-pico ,把cmakelists中的内容按我自己的系统改了改。
-
- Posts: 283
- Joined: 2024-01-08 10:59
尝试替换一下 opencv-mobile-4.8.1-luckfox-pico 包,再进行编译
-
Attachments
-
-
Downloaded 379 times