c++ - libpng 警告:使用 libpng-1.4.12 构建但使用 1.6.37 c++ mac 运行的应用程序
问题描述
我正在尝试在 vscode 中使用 OpenCV c++ 版本读取和显示图像,但我不断收到此错误:
libpng warning: Application built with libpng-1.4.12 but running with 1.6.37 libc++abi: terminating with uncaught exception of type cv::Exception: OpenCV(4.5.3) /Users/aniekan/opencv/opencv-4.5.3/modules/highgui/src/window.cpp:1006: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow'
这是我的 CmakeLists:
cmake_minimum_required(VERSION 3.0.0)
project(C++ VERSION 0.1.0)
include(CTest)
include(FindPkgConfig)
enable_testing()
pkg_check_modules(LIBPNG libpng16 REQUIRED)
if (NOT LIBPNG_FOUND)
message(FATAL ERROR "libpng16 development libaries not installed")
endif()
message(PNG_LIBRARIES = "${LIBPNG_LIBRARIES}")
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS} ${LIBPNG_INCLUDE_DIRS})
link_directories(${LIBPNG_LIBRARY_DIRS})
add_executable(C++ main.cpp)
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS} ${LIBPNG_LIBRARIES})
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
make 文件构建没有错误并找到所需的但我仍然得到错误。这是构建输出: build_output
关于这个问题有什么建议吗?
解决方案
推荐阅读
- javascript - 在 nodejs 中复制精确的 .gitignore 样式解析
- asp.net - FreeTextBox HTML 不可编辑
- javascript - 当我在日历中选择日期时,rc 日历在文本框中没有改变
- reactjs - ReactJS:由组件属性确定的动态导航栏组件
- android - 使用 viewpager 而不是用浏览器打开 url
- polygon - 多边形特例中的点
- box2d - Box2D 是否已移除“恢复原状”?
- java - 在 googleMap.setMyLocationEnabled(true) Android Studio 上获取 java.lang.NullPointerException
- dialogflow-es - 传递上下文时无法读取未定义的属性“参数” - Google 上的操作
- sql-server - 如何获取查询存储结果背后的 SQL 语句 (sys.query_store_*)