Skip to content

Can't find png during linking during vcpkg build #488

Description

@spinicist

Bug category

  • [ x ] bug - compilation error

Describe the bug

Hello. I tried to add matplotplusplus to my project using vcpkg in manifest mode today. I enabled the zlib feature as I want PNG output. When configuring I see this message:

CMake Warning at build/vcpkg_installed/arm64-osx/share/libpng/libpng-config.cmake:2 (message):
  find_package(libpng) is deprecated.

  libpng provides CMake targets:



    find_package(PNG REQUIRED)
    target_link_libraries(main PRIVATE PNG::PNG)

Call Stack (most recent call first):
  /Users/tobias/Code/vcpkg/scripts/buildsystems/vcpkg.cmake:908 (_find_package)
  /opt/local/share/cmake-3.31/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
  build/vcpkg_installed/arm64-osx/share/matplot++/Matplot++Config.cmake:53 (find_dependency)
  /Users/tobias/Code/vcpkg/scripts/buildsystems/vcpkg.cmake:908 (_find_package)
  cxx/exp/CMakeLists.txt:3 (find_package)

Then, during linking, I received ld: library 'png' not found

I suspect this is an interaction effect between vcpkg and matplotplusplus. I'm happy to report on the vcpkg repo as well if it would help.

Platform

  • [ x ] cross-platform issue - macos

Environment Details:

  • OS: MacOS
  • OS Version: 26.4.1
  • Compiler: clang++
  • CMake version: 3.31.10

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions