cmake opencv openCV_DIR路径设置问题

http://bbs.csdn.net/wap/topics/390607744#
跟这个问题一样 但还是不知道怎么操作解决 怎么能把openCV_DIR路径换到我编译到的opencv3.0.0/build中

2个回答

fanhongyuan21
威小廉 具体怎么操作呢
接近 4 年之前 回复

// for install opencv samples , 应该在安装的目录下 即(install/share/OpenCv)
1、find_package(OpenCV REQUIRED)中的OpenCV一定要遵循该大小写。
  因为该句话是根据OpenCV作为前缀自动去/usr/local/share/OpenCV(如果你的opencv安装时,默认前缀设置为:/usr/local时)文件夹中去找OpenCVConfig.cmake,OpenCV-config.cmake 两个文件,进而确定你要引入的opencv头文件和库函数在哪里。

2、自定义引入相应opencv版本
  如果你有很多的opencv版本,尤其是一个是opencv2.x.x一个是opencv3.x.x,因为2和3在数据结构上有相对较大的变化,所以如果引入错误的版本可能导致程序的无法运行。因为find_package找默认路径下的OpenCV,但是很多时候安装多个版本的库的时候都会make install在opt目录下。、
  安装在opt的文件中会有share文件夹,这里面就有咱们需要的OpenCV文件夹,所以如果要自己有选择的控制版本,则在find_package这句话前面去设置opencv的OpenCV文件夹在哪里,添加set(OpenCV_DIR /opt/opencv-2.4.11/share/OpenCV)这句话。因为我的opencv2.4.11版本install在/opt/opencv-2.4.11文件夹下。这个可以根据你install的位置去变化。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
【已经解决】 Win10环境下采用CMake编译OpenCV项目,提示无法找到opencv
1. 安装过OpenCV 4.1 win pack版本,同时安装的Intel Sensor SDK第三方软件中有opencv 3.4版本。 都按照操作要求添加了环境变量路径。 2. 采用CMake编译一个文件出现一直提示错误,这个错误应该是很多人都遇到过的。 CMakeLists.txt文件内容如下: cmake_minimum_required(VERSION 3.10) project(CvTrack) set(CMAKE_BUILD_TYPE Debug) set(OpenCV_DIR "D:/opencv/build") find_package(OpenCV REQUIRED) add_executable(CvTracking "main.cpp") target_link_libraries(CvTrack ${OpenCV_LIBS}) ********************************************************************************************************************************************************** 产生的错误提示: Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.18362. OpenCV ARCH: x86 OpenCV RUNTIME: vc14 OpenCV STATIC: OFF CMake Warning at D:/opencv/build/OpenCVConfig.cmake:166 (message): Found OpenCV Windows Pack but it has no binaries compatible with your configuration. You should manually point CMake variable OpenCV_DIR to your build of OpenCV library. Call Stack (most recent call first): CMakeLists.txt:15 (find_package) CMake Error at CMakeLists.txt:15 (find_package): Found package configuration file: D:/opencv/build/OpenCVConfig.cmake but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND. ![图片说明](https://img-ask.csdn.net/upload/201912/09/1575860198_340992.png) 安装目录如下: ![图片说明](https://img-ask.csdn.net/upload/201912/09/1575860277_399662.png) ![图片说明](https://img-ask.csdn.net/upload/201912/09/1575860289_707476.png) 请问,这个问题如何解决呢?? /==/==/==/==/==/==/==/==/==/==/==/==/==/==/==/==/==/== 解决方法: 主要原因:根据提示,OpenCVConfig.cmake文件有问题;实际在OpenCV 4.1 wind pack安装版本中,OpenCVConfig.cmake在其它路径下也有一个文件,修改路径即。 其次原因:设定的工程名为CvTrack,在add\_excuatable中的TargetName不对应。所以:重新修正了一下CMakeLists.txt: cmake_minimum_required(VERSION 3.10) project(CvTrack) set(OpenCV_DIR "D:/opencv/build/x64/vc15/lib") # 错误修正 find_package(OpenCV REQUIRED) include_directories(${OpenCV_INCLUDE_DIRS}) add_executable(CvTrack "main.cpp") # 错误修正 target_link_libraries(CvTrack ${OpenCV_LIBS})
opencv3.2与opencv 2.8 切换的问题
我的ubuntu系统原来安装了opencv2.8,现在由于实际需要,安装了opencv3.2。但是,opencv2.8还得继续保留。利用pkg-config --modversion opencv 查看opencv的版本,显示是3.2.0。原来(opencv2.8下),CMakeList文件是这样写的。 project(test) find_package(OpenCV REQUIRED) add_executable(test src/test.cpp) target_link_libraries(test ${OpenCV_LIBS}) cmake_minimum_required(VERSION 2.8) 我使用opencv3.2编译的时候,按照要求,我把路径给加上了。 project(test) find_package(OpenCV REQUIRED) set(OpenCV_DIR "/usr/local/opencv320/share/OpenCV") INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS}) add_executable(test src/test.cpp) target_link_libraries(test ${OpenCV_LIBS}) cmake_minimum_required(VERSION 3.2) 但是显示错误:要求的opencv版本太高,当前运行版本为2.8。但是我用 pkg-config --modversion opencv 查看版本,显示的是3.2.0
opencv3.1.0交叉编译出错
我在给mini2440移植opencv3.1.0的时候,make编译opencv过程中出错了。log如下: CMakeFiles/opencv_perf_core.dir/perf/perf_math.cpp.obj: In function `cv::Mat::~Mat()': perf_math.cpp.text._ZN2cv3MatD1Ev[cv::Mat::~Mat()]+0x1c): undefined reference to `__sync_fetch_and_add_4' CMakeFiles/opencv_perf_core.dir/perf/perf_compare.cpp.obj: In function `Size_MatType_CmpType_compare:erfTestBody()': perf_compare.cpp.text._ZN28Size_MatType_CmpType_compare12PerfTestBodyEv+0x30c): undefined reference to `__sync_fetch_and_add_4' perf_compare.cpp.text._ZN28Size_MatType_CmpType_compare12PerfTestBodyEv+0x378): undefined reference to `__sync_fetch_and_add_4' perf_compare.cpp.text._ZN28Size_MatType_CmpType_compare12PerfTestBodyEv+0x3ec): undefined reference to `__sync_fetch_and_add_4' CMakeFiles/opencv_perf_core.dir/perf/perf_compare.cpp.obj: In function `Size_MatType_CmpType_compareScalar:erfTestBody()': perf_compare.cpp.text._ZN34Size_MatType_CmpType_compareScalar12PerfTestBodyEv+0x32c): undefined reference to `__sync_fetch_and_add_4' CMakeFiles/opencv_perf_core.dir/perf/perf_compare.cpp.obj:perf_compare.cpp.text._ZN34Size_MatType_CmpType_compareScalar12PerfTestBodyEv+0x3a0): more undefined references to `__sync_fetch_and_add_4' follow collect2: ld returned 1 exit status make[2]: *** [bin/opencv_perf_core] Error 1 make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2 make: *** [all] Error 2 我用的是Ubuntu14.04,32位虚拟机。 查网上说是CMAKE_C_FLAGS要设为-march=armv4t 可是我安装提示设置了CMAKE_C_FLAGS 和 CMAKE_CXX_FLAGS的值,错误还是没有消失。 我试过了opencv3.1。0和opencv3.2.0了,都会出现这个问题。因为项目需求要用到opencv3 所以只能自己编译最新版,,泪奔 有大神遇到过这个问题吗?
在ubuntu下配置opencv,cmake成功了,而make时候报错
1 [ 6%] Generating precomp.hpp.gch/opencv_core_Release.gch 2 In file included from /usr/include/c++/6/bits/stl_algo.h:59:0, 3 from /usr/include/c++/6/algorithm:62, 4 from /opt/opencv/opencv-3.1.0/modules/core/include/opencv2/core/base.hpp:53, 5 from /opt/opencv/opencv-3.1.0/modules/core/include/opencv2/core.hpp:54, 6 from /opt/opencv/opencv-3.1.0/modules/core/include/opencv2/core/utility.hpp:52, 7 from /opt/opencv/build/modules/core/precomp.hpp:49: 8 /usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: 没有那个文件或目录 9 #include_next <stdlib.h> 10 ^ 11 compilation terminated. 12 modules/core/CMakeFiles/pch_Generate_opencv_core.dir/build.make:62: recipe for target 'modules/core/precomp.hpp.gch/opencv_core_Release.gch' failed 13 make[2]: *** [modules/core/precomp.hpp.gch/opencv_core_Release.gch] Error 1 14 CMakeFiles/Makefile2:1178: recipe for target 'modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all' failed 15 make[1]: *** [modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all] Error 2 16 Makefile:160: recipe for target 'all' failed 17 make: *** [all] Error 2 ![图片说明](https://img-ask.csdn.net/upload/201703/03/1488542516_717767.png)
ubantu16 安装opencv3.2 在 cmake时出项很多问题
FP16: Feature disabled -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.8", minimum required is "1.2.3") -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8") -- Found OpenEXR: /usr/lib/x86_64-linux-gnu/libIlmImf.so CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package): By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Core", but CMake did not find one. Could not find a package configuration file provided by "Qt5Core" with any of the following names: Qt5CoreConfig.cmake qt5core-config.cmake Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set "Qt5Core_DIR" to a directory containing one of the above files. If "Qt5Core" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package): By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Gui", but CMake did not find one. Could not find a package configuration file provided by "Qt5Gui" with any of the following names: Qt5GuiConfig.cmake qt5gui-config.cmake Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set "Qt5Gui_DIR" to a directory containing one of the above files. If "Qt5Gui" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package): By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Widgets", but CMake did not find one. Could not find a package configuration file provided by "Qt5Widgets" with any of the following names: Qt5WidgetsConfig.cmake qt5widgets-config.cmake Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set "Qt5Widgets_DIR" to a directory containing one of the above files. If "Qt5Widgets" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package): By not providing "FindQt5Test.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Test", but CMake did not find one. Could not find a package configuration file provided by "Qt5Test" with any of the following names: Qt5TestConfig.cmake qt5test-config.cmake Add the installation prefix of "Qt5Test" to CMAKE_PREFIX_PATH or set "Qt5Test_DIR" to a directory containing one of the above files. If "Qt5Test" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) CMake Warning at cmake/OpenCVFindLibsGUI.cmake:22 (find_package): By not providing "FindQt5Concurrent.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5Concurrent", but CMake did not find one. Could not find a package configuration file provided by "Qt5Concurrent" with any of the following names: Qt5ConcurrentConfig.cmake qt5concurrent-config.cmake Add the installation prefix of "Qt5Concurrent" to CMAKE_PREFIX_PATH or set "Qt5Concurrent_DIR" to a directory containing one of the above files. If "Qt5Concurrent" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:556 (include) -- Looking for Q_WS_X11 -- Looking for Q_WS_X11 - found -- Looking for Q_WS_WIN -- Looking for Q_WS_WIN - not found -- Looking for Q_WS_QWS -- Looking for Q_WS_QWS - not found -- Looking for Q_WS_MAC -- Looking for Q_WS_MAC - not found -- Found Qt4: /usr/bin/qmake (found version "4.8.7") -- Checking for module 'gstreamer-base-1.0' -- No package 'gstreamer-base-1.0' found -- Checking for module 'gstreamer-video-1.0' -- No package 'gstreamer-video-1.0' found -- Checking for module 'gstreamer-app-1.0' -- No package 'gstreamer-app-1.0' found -- Checking for module 'gstreamer-riff-1.0' -- No package 'gstreamer-riff-1.0' found -- Checking for module 'gstreamer-pbutils-1.0' -- No package 'gstreamer-pbutils-1.0' found -- Checking for module 'gstreamer-base-0.10' -- Found gstreamer-base-0.10, version 0.10.36 -- Checking for module 'gstreamer-video-0.10' -- Found gstreamer-video-0.10, version 0.10.36 -- Checking for module 'gstreamer-app-0.10' -- Found gstreamer-app-0.10, version 0.10.36 -- Checking for module 'gstreamer-riff-0.10' -- Found gstreamer-riff-0.10, version 0.10.36 -- Checking for module 'gstreamer-pbutils-0.10' -- Found gstreamer-pbutils-0.10, version 0.10.36 -- Checking for module 'libxine' -- No package 'libxine' found -- Looking for linux/videodev.h -- Looking for linux/videodev.h - not found -- Looking for linux/videodev2.h -- Looking for linux/videodev2.h - found -- Looking for sys/videoio.h -- Looking for sys/videoio.h - not found -- Checking for module 'libavresample' -- No package 'libavresample' found -- Checking for module 'libgphoto2' -- No package 'libgphoto2' found -- Found TBB: /usr/lib/x86_64-linux-gnu/libtbb.so CMake Error at cmake/OpenCVFindIPP.cmake:243 (include): include could not find load file: ...................... CMake Warning at CMakeLists.txt:1356 (message): The source directory is the same as binary directory. "make clean" may damage the source tree -- Configuring incomplete, errors occurred! See also "/home/zyz/文档/opencv-3.2.0/CMakeFiles/CMakeOutput.log". See also "/home/zyz/文档/opencv-3.2.0/CMakeFiles/CMakeError.log".
opencv配置成功后,进行测试时出错
CMake Warning at /home/obvious/opencv/cmake/OpenCVConfig.cmake:166 (message): Found OpenCV Windows Pack but it has no binaries compatible with your configuration. You should manually point CMake variable OpenCV_DIR to your build of OpenCV library. Call Stack (most recent call first): CMakeLists.txt:10 (find_package) CMake Error at CMakeLists.txt:10 (find_package): Found package configuration file: /home/obvious/opencv/cmake/OpenCVConfig.cmake but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be NOT FOUND. ![图片说明](https://img-ask.csdn.net/upload/201703/05/1488699720_108187.png)
求教,cmake找不到库,帮帮忙,感激
1.cmake老是提示找不到boost库![图片说明](https://img-ask.csdn.net/upload/201505/20/1432082094_997788.png) 2.我增加了link_directories(F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_0/lib64-msvc-10.0)还是没有用 3.cmakelist.text 主 ``` project(superviseddescent) cmake_minimum_required(VERSION 2.8.7) set(superviseddescent_VERSION_MAJOR 0) set(superviseddescent_VERSION_MINOR 3) set(superviseddescent_VERSION_PATCH 0) set (BOOST_ROOT,"F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_0") set(Boost_LIBRARIES,"F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_0/lib64-msvc-10.0") message(STATUS "BOOST_ROOT: ${BOOST_ROOT}") # g++ needs a compiler flag to enable C++11 support include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-std=c++11 HAS_CXX11_FLAG) if (HAS_CXX11_FLAG) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif() # All the options for building the library. Can be changed on the command-line or in initial_cache.cmake. message(STATUS "Options:") option(BUILD_TESTS "Builds the unit tests." ON) message(STATUS "BUILD_TESTS: ${BUILD_TESTS}") option(BUILD_EXAMPLES "Build the example applications." ON) message(STATUS "BUILD_EXAMPLES: ${BUILD_EXAMPLES}") option(BUILD_DOCUMENTATION "Build the library documentation." ON) message(STATUS "BUILD_DOCUMENTATION: ${BUILD_DOCUMENTATION}") # Build a CPack driven installer package: include(InstallRequiredSystemLibraries) # This module will include any runtime libraries that are needed by the project for the current platform set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set(CPACK_PACKAGE_VERSION_MAJOR "${superviseddescent_VERSION_MAJOR}") set(CPACK_PACKAGE_VERSION_MINOR "${superviseddescent_VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_PATCH "${superviseddescent_VERSION_PATCH}") include(CPack) #set(Boost_USE_STATIC_LIBS OFF) # Find dependencies: find_package(OpenCV 2.4.3 REQUIRED core) message(STATUS "OpenCV include dir found at ${OpenCV_INCLUDE_DIRS}") message(STATUS "xxxxxxBoost found at ${Boost_INCLUDE_DIRS}") message(STATUS "OpenCV lib dir found at ${OpenCV_LIB_DIR}") link_directories(F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_0/lib64-msvc-10.0) link_directories(F:/Proj/20150519/superviseddescent-master/superviseddescent-master/boost_1_54_02/bin/vc10/lib) find_package(Boost 1.48.0 COMPONENTS system serialization REQUIRED) if(Boost_FOUND) #message(STATUS "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa ${Boost_INCLUDE_DIRS}/bin/vc10/lib") message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}") else(Boost_FOUND) message(FATAL_ERROR "Boost not found") endif() message(STATUS "xxxxxxxxxxxxxxxxxxxxxxxx ${Boost_LIBRARIES}") set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) find_package(Eigen3 REQUIRED) message(STATUS "Eigen3 found: ${EIGEN3_FOUND}") message(STATUS "Eigen3 include dir found at ${EIGEN3_INCLUDE_DIR}") message(STATUS "Eigen3 version: ${EIGEN3_VERSION}") # Source and header files set(HEADERS include/superviseddescent/superviseddescent.hpp include/superviseddescent/regressors.hpp include/superviseddescent/matserialisation.hpp include/superviseddescent/utils/ThreadPool.h ) # Add header includes: include_directories("include") include_directories(${Boost_INCLUDE_DIRS}) include_directories(${OpenCV_INCLUDE_DIRS}) include_directories(${EIGEN3_INCLUDE_DIR}) # The install target: install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION include) if(BUILD_TESTS) message(STATUS "Configuring gtest-1.7.0...") set(gtest_force_shared_crt ON CACHE BOOL "Use shared (DLL) run-time lib (CRT) even when Google Test is built as static lib.") # THIS IS NEWEST add_subdirectory(3rdparty/gtest-1.7.0) message(STATUS "Finished configuring gtest.") enable_testing() # Enables CTest add_custom_target(check-dbg COMMAND ${CMAKE_CTEST_COMMAND} -V -C Debug) # to get detailed output on VS add_custom_target(check-rel COMMAND ${CMAKE_CTEST_COMMAND} -V -C Release) add_subdirectory(test) endif() if(BUILD_EXAMPLES) add_subdirectory(examples) endif() if(BUILD_DOCUMENTATION) add_subdirectory(doc) endif() ``` cmakelist.text 子文件夹 ``` # Unit tests # ========== # Note: All the variables in here are inherited from the parent CMakeLists find_package(OpenCV 2.4.3 REQUIRED core) message(STATUS "OpenCV include dir found at ${OpenCV_INCLUDE_DIRS}") message(STATUS "OpenCV lib dir found at ${OpenCV_LIB_DIR}") message(STATUS "OpenCV lib dir aaaaaat ${OpenCV_LIB_DIR}") include_directories(${gtest_SOURCE_DIR}/include) set(TEST_LINREG1D test_LinearRegressor1D) add_executable(${TEST_LINREG1D} test_LinearRegressor1D.cpp) #link_directories(${BOOST_ROOT}/bin/vc10/lib) target_link_libraries(${TEST_LINREG1D} ${OpenCV_LIBS} ${Boost_LIBRARIES} gtest_main gtest) add_test(${TEST_LINREG1D} ${TEST_LINREG1D}) # Syntax: testname exename set(TEST_LINREGND test_LinearRegressorND) add_executable(${TEST_LINREGND} test_LinearRegressorND.cpp) target_link_libraries(${TEST_LINREGND} ${OpenCV_LIBS} ${Boost_LIBRARIES} gtest_main gtest) add_test(${TEST_LINREGND} ${TEST_LINREGND}) set(TEST_SDO test_SupervisedDescentOptimiser) add_executable(${TEST_SDO} test_SupervisedDescentOptimiser.cpp) target_link_libraries(${TEST_SDO} ${OpenCV_LIBS} ${Boost_LIBRARIES} gtest_main gtest) add_test(${TEST_SDO} ${TEST_SDO}) ``` 4.目录如下![图片说明](https://img-ask.csdn.net/upload/201505/20/1432082538_83078.png) 5.boost目录![图片说明](https://img-ask.csdn.net/upload/201505/20/1432082621_906489.png) 6.boost库![图片说明](https://img-ask.csdn.net/upload/201505/20/1432082701_66544.png)
ubuntu 安装配置c++的opencv 报错
我在ubuntu 上打算安装和配置c++的Opencv, 下载了opencv3.1.0版本的代码,然后也手动的下载了ippicv_linux_20151201.tgz。创建build文件夹后Cmake命令已经可以编译过去了。 但是在执行make命令的时候,经常会报错: ``` [ 15%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/opencl_kernels_core.cpp.o [ 15%] Linking CXX shared library ../../lib/libopencv_core.so /usr/bin/ld: CMakeFiles/opencv_core.dir/src/va_intel.cpp.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC CMakeFiles/opencv_core.dir/src/va_intel.cpp.o: 无法添加符号: 错误的值 collect2: error: ld returned 1 exit status modules/core/CMakeFiles/opencv_core.dir/build.make:1382: recipe for target 'lib/libopencv_core.so.3.1.0' failed make[2]: *** [lib/libopencv_core.so.3.1.0] Error 1 CMakeFiles/Makefile2:1420: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 Makefile:160: recipe for target 'all' failed make: *** [all] Error 2 ``` 有时候在33%进度的时候报这个错误,有时候就在15%时候报。我整整试了一整天,查遍了各种解决方法都无济于事。请大侠们帮忙解决下吧。跪谢。 是否有直接加载已经编译好的库的方式,可以快速实现配置,因为我急需要用Opencv实现代码。感谢各位大侠了。
windows环境下codeblocks17.12 用cmake配置opencv3.4.7出现如下错误
试了好多次了,参考了不少博主的文章编译,还是有错 ``` F:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `CMakeFiles\opencv_core.dir/objects.a(vs_version.rc.obj)' is incompatible with i386:x86-64 output collect2.exe: error: ld returned 1 exit status modules\core\CMakeFiles\opencv_core.dir\build.make:1843: recipe for target 'bin/libopencv_core340.dll' failed mingw32-make[2]: *** [bin/libopencv_core340.dll] Error 1 CMakeFiles\Makefile2:1686: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed mingw32-make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 Makefile:161: recipe for target 'all' failed mingw32-make: *** [all] Error 2 ```
CMakeLists编译出错,如何使用?
cmake_minimum_required(VERSION 2.8 FATAL_ERROR) project(kinect_capture) set(FREENECT_DIR "c:/code/libfreenect") set(FREENECT_BUILD_DIR "c:/code/libfreenect_build") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${FREENECT_DIR}/cmake_modules/") #Boost set(BOOST_ROOT "c:/code/boost_1_47_0") set(BOOST_LIBRARYDIR "C:/code/boost_1_47_0/stage/lib") set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) find_package(Boost COMPONENTS date_time) include_directories(${Boost_INCLUDE_DIRS}) link_directories(${BOOST_LIBRARYDIR}) #VTK #find_package(VTK) #if(VTK_FOUND) # INCLUDE(${VTK_USE_FILE}) #endif() f #PCL #find_package(PCL 1.1 COMPONENTS common visualization) #include_directories(${PCL_INCLUDE_DIRS}) #link_directories(${PCL_LIBRARY_DIRS}) #add_definitions(${PCL_DEFINITIONS}) #OpenCV set(OpenCV_DIR "C:/code/OpenCV2.2/build") find_package(OpenCV COMPONENTS filesystem) include_directories(${OpenCV_INCLUDE_DIRS}) link_directories(${OpenCV_LIB_DIR}) #OpenGL find_package(OpenGL REQUIRED) find_package(GLUT REQUIRED) include_directories(${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ${USB_INCLUDE_DIRS}) #include_directories("C:/code/glew-1.7.0/include") #include_directories("C:/code/glew-1.7.0/lib") #Glui include_directories("C:/code/glui-2.35/src/include") link_directories("c:/code/glui-2.35/src/msvc/lib") #PTHREAD set(THREADS_PTHREADS_INCLUDE_DIR "c:/code/pthreads-2-8-0/include") set(THREADS_PTHREADS_WIN32_LIBRARY "c:/code/pthreads-2-8-0/lib/pthreadVC2.lib") set(THREADS_USE_PTHREADS_WIN32 true) find_package(Threads REQUIRED) include_directories(${THREADS_PTHREADS_INCLUDE_DIR}) #USB set(LIBUSB_1_INCLUDE_DIR "C:/code/libusb-1.2.5.0/include") set(LIBUSB_1_LIBRARY "C:/code/libusb-1.2.5.0/lib/msvc/libusb.lib") find_package(libusb-1.0 REQUIRED) include_directories(${LIBUSB_1_INCLUDE_DIRS}) include_directories("${FREENECT_DIR}/platform/windows") include_directories("${FREENECT_DIR}/platform/windows/libusb10emu") #Freenect include_directories("${FREENECT_DIR}/include") #set(FREENECT_LIBRARY_DIR optimized "${FREENECT_BUILD_DIR}/lib/Release/" debug "${FREENECT_BUILD_DIR}/lib/Debug/") set(FREENECT_LIBRARY_DIR "${FREENECT_BUILD_DIR}/lib/") link_directories(${FREENECT_LIBRARY_DIR}) set(FREENECT_LIBRARIES "freenect.lib") #Files file(GLOB_RECURSE INCS "*.h") set(SRCS kinect_capture.cpp kinect_capture_app.cpp kinect_calibration.cpp freenect_module.cpp ) #Build add_executable (kinect_capture ${SRCS} ${INCS}) target_link_libraries (kinect_capture ${FREENECT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${LIBUSB_1_LIBRARIES} ${OpenCV_LIBS} ${Boost_LIBRARIES}) #${PCL_LIBRARIES} ${VTK_LIBRARIES} 这是cmakelist的全部内容,#Boost,#VTK,#PCL,#OpenCV,#OpenGL,#Glui,#PTHREAD,#Freenect这些在电脑里都要有吗??
Android studio JNI 使用 CMakeLists 如何让import的so库 生成到输出目录?
引入第三方so 通过 ``` add_library(Opencv SHARED IMPORTED) set_target_properties(AlgInterface PROPERTIES IMPORTED_LOCATION ${opencvpath}) ``` 链接so ``` target_link_libraries(myso Opencv) ``` 设置输出目录 ``` set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../jniLibs/${ANDROID_ABI}) ``` 输出目录中只有myso 没有 opencv ,如何让opencv同时生成到 输出目录呢 Android.mk中 可以直接构建库 ``` LOCAL_MODULE := Opencv LOCAL_SRC_FILES := $(LOCAL_PATH)/libopencv.so ``` 但是CMakeLists中 add_library 源文件不能是so CMakeLists中有什么类似的方式么 或者其他好的办法
通过MakeFile文件了解项目目录结构,编写CMake的CMakelist.txt文件方法。
主项目: CC = gcc CFLAGS += -O3 BIN_DIR = ./bin SRC_DIR = ./src DOC_DIR = ./docs INC_DIR = ./include LIB_DIR = ./lib BIN = siftfeat match dspfeat all: $(BIN) libopensift.a docs docs: doxygen Doxyfile libopensift.a: make -C $(SRC_DIR) $@ $(BIN): make -C $(SRC_DIR) $@ clean: make -C $(SRC_DIR) $@; \ make -C $(INC_DIR) $@; \ distclean: clean rm -f $(LIB_DIR)/* rm -f $(BIN_DIR)/* docsclean: rm -rf $(DOC_DIR)/html/ .PHONY: docs clean docsclean libopensift.a scr文件: CC = gcc CFLAGS += BIN_DIR = ../bin INC_DIR = ../include LIB_DIR = ../lib INCL = -I$(INC_DIR) `pkg-config --cflags opencv gtk+-2.0` LIBS = -L$(LIB_DIR) -lopensift -lm `pkg-config --libs opencv gtk+-2.0` OBJ = imgfeatures.o utils.o sift.o kdtree.o minpq.o xform.o BIN = siftfeat match dspfeat all: $(BIN) libopensift.a libopensift.a: $(OBJ) ar rc $(LIB_DIR)/$@ $(OBJ) ranlib $(LIB_DIR)/$@ siftfeat: libopensift.a siftfeat.c $(CC) $(CFLAGS) $(INCL) siftfeat.c -o $(BIN_DIR)/$@ $(LIBS) match: libopensift.a match.c $(CC) $(CFLAGS) $(INCL) match.c -o $(BIN_DIR)/$@ $(LIBS) dspfeat: libopensift.a dspfeat.c $(CC) $(CFLAGS) $(INCL) dspfeat.c -o $(BIN_DIR)/$@ $(LIBS) imgfeatures.o: imgfeatures.c $(INC_DIR)/imgfeatures.h $(CC) $(CFLAGS) $(INCL) -c imgfeatures.c -o $@ utils.o: utils.c $(INC_DIR)/utils.h $(CC) $(CFLAGS) $(INCL) -c utils.c -o $@ sift.o: sift.c $(INC_DIR)/sift.h $(CC) $(CFLAGS) $(INCL) -c sift.c -o $@ kdtree.o: kdtree.c $(INC_DIR)/kdtree.h $(CC) $(CFLAGS) $(INCL) -c kdtree.c -o $@ minpq.o: minpq.c $(INC_DIR)/minpq.h $(CC) $(CFLAGS) $(INCL) -c minpq.c -o $@ xform.o: xform.c $(INC_DIR)/xform.h $(CC) $(CFLAGS) $(INCL) -c xform.c -o $@ clean: rm -f *~ *.o core .PHONY: clean include文件: clean: rm -f *~ .PHONY: clean
WINDOWS下用Cmake弄CodeBlocks + OPenCV 3.3配置时出错
![图片说明](https://img-ask.csdn.net/upload/201709/01/1504234665_410763.png) ![图片说明](https://img-ask.csdn.net/upload/201709/01/1504234672_719273.png) 这个文件 Building RC object modules/core/CMakeFiles/opencv_core.dir/vs_version.rc. obj 有没有大神救救我...
为什么Opencv3.4.0使用make编译时出现错误?
环境:Debian(Raspiberry Pi Buster) cmake version: 3.0.2 gcc version: 8.2.0 python version: 3.7.2 make version: 4.2.1 本来计划用opencv基于python进行图像辨别 在使用cmake配置完成后使用make命令编译: ``` sudo make ``` 编译到大约90%时,出现如下错误: ``` #这是之前很多条控制台信息中的warning warning: cast between incompatible function types from ‘PyObject* (*)(PyObject*, PyObject*, PyObject*)’ {aka ‘_object* (*)(_object*, _object*, _object*)’} to ‘PyCFunction’ {aka ‘_object* (*)(_object*, _object*)’} [-Wcast-function-type] ``` ``` #make错误,退出 make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/build.make:56: modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:21149: modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2 make: *** [Makefile:138: all] Error 2 ``` 如图(图1中使用了make -i选项忽略错误,继续编译剩余部分,但open_cv python3没有成功编译): ![图片说明](https://img-ask.csdn.net/upload/201908/11/1565498546_278259.png) (图2显示了make的错误) ![图片说明](https://img-ask.csdn.net/upload/201908/11/1565499335_385379.png) ``` #忽略错误后出现的c++error c++: error: Cmakefiles/opencv_python3.dir/__/src2/cv2.cpp.o No such file or dictionary ``` 在网上看到的编译错误的例子都和这个有所区别,没有能够很好地解决问题。有的说这是gcc编译器的问题 希望各位大佬们能够帮忙分析一下错误的原因,因为我的项目急需配置好opencv,也没有其它更好的替代,谢谢~
opencv配置在qt5.6上的问题
通过cmake 3.7.2 Configure OpenCV3.2的source文件遇到以下问题: Make Error at D:/pack/opencv/cmake-3.7.2-64位/cmake-3.7.2-win64-x64/share/cmake-3.7/Modules/CMakeTestCXXCompiler.cmake:44 (message): The C++ compiler "D:/qtcreator/Tools/mingw492_32/bin/g++.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: D:/pack/opencv/release/CMakeFiles/CMakeTmp Run Build Command:"D:/qtcreator/Tools/mingw492_32/bin/mingw32-make.exe" "cmTC_97ee7/fast" D:/qtcreator/Tools/mingw492_32/bin/mingw32-make.exe -f CMakeFiles\cmTC_97ee7.dir\build.make CMakeFiles/cmTC_97ee7.dir/build mingw32-make.exe[1]: Entering directory 'D:/pack/opencv/release/CMakeFiles/CMakeTmp' CMakeFiles\cmTC_97ee7.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_97ee7.dir/testCXXCompiler.cxx.obj' failed process_begin: CreateProcess(NULL, D:\pack\opencv\cmake-3.7.2-64位\cmake-3.7.2-win64-x64\bin\cmake.exe -E cmake_echo_color --switch= --progress-dir=D:\pack\opencv\release\CMakeFiles\CMakeTmp\CMakeFiles --progress-num=1 "Building CXX object CMakeFiles/cmTC_97ee7.dir/testCXXCompiler.cxx.obj", ...) failed. make (e=2): 系统找不到指定的文件。 mingw32-make.exe[1]: *** [CMakeFiles/cmTC_97ee7.dir/testCXXCompiler.cxx.obj] Error 2 mingw32-make.exe[1]: Leaving directory 'D:/pack/opencv/release/CMakeFiles/CMakeTmp' makefile:125: recipe for target 'cmTC_97ee7/fast' failed mingw32-make.exe: *** [cmTC_97ee7/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:98 (project)
谁能帮忙看一下OpenCV 3.4.1源码的类型转换编译错误?
环境: 1. Ubuntu 12.04 LTS 2. cmake 3.5.1 3. OpenCV 3.4.1源码 4. Arm Cortex-A7 NXP i.MX6Q 5. 已经sudo为root 执行过程 cd opencv-3.4.1 mkdir build cd build cmakd -D CMAKE_BUILD_TYPE=Relase -D CMAKE_INSTALL_PREFIX=/usr/local .. make make install 出错提示: [ 0%] Built target gen-pkgconfig [ 9%] Built target libwebp [ 14%] Built target IlmImf [ 20%] Built target libprotobuf [ 23%] Built target carotene_objs [ 24%] Built target tegra_hal [ 24%] Built target opencv_ts_pch_dephelp [ 24%] Built target pch_Generate_opencv_ts [ 25%] Built target opencv_core_pch_dephelp [ 25%] Built target pch_Generate_opencv_core [ 31%] Built target opencv_core [ 31%] Built target opencv_imgproc_pch_dephelp [ 31%] Built target pch_Generate_opencv_imgproc [ 31%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/smooth.cpp.o /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth1N(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2676:31: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2676:31: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:223:22: note: {anonymous}::ufixedpoint32::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:222:22: note: {anonymous}::ufixedpoint32::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:221:22: note: {anonymous}::ufixedpoint32::operator ET() const [with ET = unsigned char] /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth1N1(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2693:24: error: conversion from ‘const {anonymous}::ufixedpoint16’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2693:24: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:289:22: note: {anonymous}::ufixedpoint16::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:288:22: note: {anonymous}::ufixedpoint16::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:287:22: note: {anonymous}::ufixedpoint16::operator ET() const [with ET = unsigned char] /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth3N(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2740:71: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2740:71: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:223:22: note: {anonymous}::ufixedpoint32::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:222:22: note: {anonymous}::ufixedpoint32::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:221:22: note: {anonymous}::ufixedpoint32::operator ET() const [with ET = unsigned char] /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth5N(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2816:109: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2816:109: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:223:22: note: {anonymous}::ufixedpoint32::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:222:22: note: {anonymous}::ufixedpoint32::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:221:22: note: {anonymous}::ufixedpoint32::operator ET() const [with ET = unsigned char] /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp: In function ‘void cv::vlineSmooth(const FT* const*, const FT*, int, ET*, int) [with ET = unsigned char, FT = {anonymous}::ufixedpoint16]’: /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2919:18: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2914:23: note: candidates are: /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:223:22: note: {anonymous}::ufixedpoint32::operator float() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:222:22: note: {anonymous}::ufixedpoint32::operator double() const /home/linaro/opencv-3.4.1/modules/imgproc/src/fixedpoint.inl.hpp:221:22: note: {anonymous}::ufixedpoint32::operator ET() const [with ET = unsigned char] make[2]: *** [modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/smooth.cpp.o] Error 1 make[1]: *** [modules/imgproc/CMakeFiles/opencv_imgproc.dir/all] Error 2 make: *** [all] Error 2 说明: 关键之处是 /home/linaro/opencv-3.4.1/modules/imgproc/src/smooth.cpp:2919:18: error: conversion from ‘{anonymous}::ufixedpoint32’ to ‘cv::uint8_t {aka unsigned char}’ is ambiguous 类型转换错误。 请教各位大侠,这个错误出在哪里,如何解决呢? 谢谢!
跪求cmake交叉编译出错原因!!!
Linking CXX shared library ../../lib/libopencv_core.so /opt/EmbedSky/4.4.6/lib/gcc/arm-embedsky-linux-gnueabi/4.4.6/../../../../arm-embedsky-linux-gnueabi/bin/ld: ../../3rdparty/lib/libzlib.a(inflate.c.obj): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC ../../3rdparty/lib/libzlib.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [lib/libopencv_core.so] 错误 1 make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] 错误 2 make: *** [all] 错误 2 请问这是什么错误啊? opencv路径及版本:/usr/local/ Opencv2.4.1 cmake路径及版本:/usr/local/ cmake-2.8.12.2-Linux-i386 用户:root
linux安装opencv,执行cmake .报错
CMakeError.log内容: cc1plus: 警告:命令行选项“-Wmissing-prototypes”对 C/ObjC 是有效的,但对 C++ 无效 cc1plus: 警告:命令行选项“-Wstrict-prototypes”对 C/ObjC 是有效的,但对 C++ 无效 cc1plus: 警告:命令行选项“-Wno-missing-declarations”对 C/ObjC 是有效的,但对 C++ 无效 cc1plus: 错误:无法识别的命令行选项“-Wno-misleading-indentation” make[1]: *** [CMakeFiles/cmTC_16c2d.dir/src.cxx.o] 错误 1 make[1]: Leaving directory `/home/d5000/fujian/opencv-3.2.0/CMakeFiles/CMakeTmp' make: *** [cmTC_16c2d/fast] 错误 2
OpenCV4Android求大神解决
Build command failed. Error while executing process D:\AS\sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build E:\lichao\study\android\code\OpenCV4AndroidFace\app\.externalNativeBuild\cmake\debug\arm64-v8a --target opencv341} [1/2] Building CXX object CMakeFiles/opencv341.dir/src/main/cpp/DetectionBasedTracker_jni.cpp.o FAILED: D:\AS\sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android --gcc-toolchain=D:/AS/sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64 --sysroot=D:/AS/sdk/ndk-bundle/sysroot -Dopencv341_EXPORTS -I../../../../src/main/cpp/include -isystem D:/AS/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem D:/AS/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include -isystem D:/AS/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -isystem D:/AS/sdk/ndk-bundle/sysroot/usr/include/aarch64-linux-android -D__ANDROID_API__=21 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -frtti -fexceptions -std=gnu++11 -fexceptions -frtti -O2 -DNDEBUG -fPIC -MD -MT CMakeFiles/opencv341.dir/src/main/cpp/DetectionBasedTracker_jni.cpp.o -MF CMakeFiles\opencv341.dir\src\main\cpp\DetectionBasedTracker_jni.cpp.o.d -o CMakeFiles/opencv341.dir/src/main/cpp/DetectionBasedTracker_jni.cpp.o -c E:\lichao\study\android\code\OpenCV4AndroidFace\app\src\main\cpp\DetectionBasedTracker_jni.cpp E:\lichao\study\android\code\OpenCV4AndroidFace\app\src\main\cpp\DetectionBasedTracker_jni.cpp:1:10: error: 'DetectionBasedTracker_jni.h' file not found with <angled> include; use "quotes" instead #include <DetectionBasedTracker_jni.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "DetectionBasedTracker_jni.h" 1 error generated. ninja: build stopped: subcommand failed.
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
使用 Docker 部署 Spring Boot 项目
Docker 技术发展为微服务落地提供了更加便利的环境,使用 Docker 部署 Spring Boot 其实非常简单,这篇文章我们就来简单学习下。首先构建一个简单的 S...
英特尔不为人知的 B 面
从 PC 时代至今,众人只知在 CPU、GPU、XPU、制程、工艺等战场中,英特尔在与同行硬件芯片制造商们的竞争中杀出重围,且在不断的成长进化中,成为全球知名的半导体公司。殊不知,在「刚硬」的背后,英特尔「柔性」的软件早已经做到了全方位的支持与支撑,并持续发挥独特的生态价值,推动产业合作共赢。 而对于这一不知人知的 B 面,很多人将其称之为英特尔隐形的翅膀,虽低调,但是影响力却不容小觑。 那么,在...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
刷了几千道算法题,这些我私藏的刷题网站都在这里了!
遥想当年,机缘巧合入了 ACM 的坑,周边巨擘林立,从此过上了"天天被虐似死狗"的生活… 然而我是谁,我可是死狗中的战斗鸡,智力不够那刷题来凑,开始了夜以继日哼哧哼哧刷题的日子,从此"读题与提交齐飞, AC 与 WA 一色 ",我惊喜的发现被题虐既刺激又有快感,那一刻我泪流满面。这么好的事儿作为一个正直的人绝不能自己独享,经过激烈的颅内斗争,我决定把我私藏的十几个 T 的,阿不,十几个刷题网...
白话阿里巴巴Java开发手册高级篇
不久前,阿里巴巴发布了《阿里巴巴Java开发手册》,总结了阿里巴巴内部实际项目开发过程中开发人员应该遵守的研发流程规范,这些流程规范在一定程度上能够保证最终的项目交付质量,通过在时间中总结模式,并推广给广大开发人员,来避免研发人员在实践中容易犯的错误,确保最终在大规模协作的项目中达成既定目标。 无独有偶,笔者去年在公司里负责升级和制定研发流程、设计模板、设计标准、代码标准等规范,并在实际工作中进行...
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
redis分布式锁,面试官请随便问,我都会
文章有点长并且绕,先来个图片缓冲下! 前言 现在的业务场景越来越复杂,使用的架构也就越来越复杂,分布式、高并发已经是业务要求的常态。像腾讯系的不少服务,还有CDN优化、异地多备份等处理。 说到分布式,就必然涉及到分布式锁的概念,如何保证不同机器不同线程的分布式锁同步呢? 实现要点 互斥性,同一时刻,智能有一个客户端持有锁。 防止死锁发生,如果持有锁的客户端崩溃没有主动释放锁,也要保证锁可以正常释...
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
Java世界最常用的工具类库
Apache Commons Apache Commons有很多子项目 Google Guava 参考博客
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下...
为什么要学数据结构?
一、前言 在可视化化程序设计的今天,借助于集成开发环境可以很快地生成程序,程序设计不再是计算机专业人员的专利。很多人认为,只要掌握几种开发工具就可以成为编程高手,其实,这是一种误解。要想成为一个专业的开发人员,至少需要以下三个条件: 1) 能够熟练地选择和设计各种数据结构和算法 2) 至少要能够熟练地掌握一门程序设计语言 3) 熟知所涉及的相关应用领域的知识 其中,后两个条件比较容易实现,而第一个...
Android 9.0 init 启动流程
阅读五分钟,每日十点,和您一起终身学习,这里是程序员Android本篇文章主要介绍Android开发中的部分知识点,通过阅读本篇文章,您将收获以下内容:一、启动流程概述一、 启动流程概述Android启动流程跟Linux启动类似,大致分为如下五个阶段。1.开机上电,加载固化的ROM。2.加载BootLoader,拉起Android OS。3.加载Uboot,初始外设,引导Kernel启动等。...
相关热词 c# 图片上传 c# gdi 占用内存 c#中遍历字典 c#控制台模拟dos c# 斜率 最小二乘法 c#进程延迟 c# mysql完整项目 c# grid 总行数 c# web浏览器插件 c# xml 生成xsd
立即提问