Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] How can I resolve 'system-png' was enabled ... when building qt5 using conan2 and CMake #17005

Open
1 task done
CheerThe2nd opened this issue Sep 17, 2024 · 3 comments

Comments

@CheerThe2nd
Copy link

What is your question?

I am somewhat new to C/C++ build systems, and I am trying to use Conan2 with CMake to create a Qt5 project, but I keep getting the following error:

ERROR: Feature 'system-png' was enabled, but the pre-condition 'features.png && libs.libpng' failed.

qt/5.15.11: ERROR:
Package '020a7cd993e36db783fa98d5d067f534b330337c' build failed
qt/5.15.11: WARN: Build folder C:\Users\xxx\.conan2\p\b\qt663cecdfcc715\b
ERROR: qt/5.15.11: Error in build() method, line 843
        self.run("%s %s" % (os.path.join(self.source_folder, "qt5", "configure"), " ".join(args)))
        ConanException: Error 3 while executing

This error occurs when running the following command:
conan install . --output-folder=build --build=missing

I was following the offcial conan2 guide and thought that I could just add qwt/6.2.0 to the [requires] block, but apparently this is not the case.

  • Python version : Python 3.10.6
  • Pip version : pip 22.2.1
  • Compiler+version: MSVC 2022
  • CMake Version: 3.15
  • Operating System+version: Windows 10
  • Conan version: Conan 2.7.1

This is my project structure:
Project

├── CMakeLists.txt

├── conanfile.txt

└── src

└── main.cpp

This is my conanfile.txt (copied it from the conancenter):

[requires]
qt/5.15.11

[generators]
CMakeDeps
CMakeToolchain

[layout]
cmake_layout

I tried to look for missing dependencies but I could not find anything but according to the error message it seems like I am missing some kind of lib called lippng. So I tried to also add libpng/1.6.43 from the conancenter.
I then tried to go to the offical website libpng and download some binaries from there and look if I have to create envirment variable but this got me nowhere.

As I said I am somwhat new to this and I am sure that I did something wrong but I just can not figure out what's the problem. I hope this is no dublicate or a lazy question.

Here is a larger snippet of the terminal output:

Configure summary:

Build type: win32-msvc (x86_64, CPU features: sse sse2)
Compiler: msvc 194033811
Configuration: sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples f16c largefile precompile_header rdrnd rdseed shani silent x86SimdAlways release c++11 c++14 c++17 c++1z concurrent no-pkg-config static stl
Build options:
  Mode ................................... release
  Optimize release build for size ........ no
  Building shared libraries .............. no
  Using C standard ....................... C89
  Using C++ standard ..................... C++17
  Relocatable ............................ no
  Using precompiled headers .............. yes
  Using LTCG ............................. no
  Target compiler supports:
    SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
    AVX .................................. AVX AVX2
    AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI
    Other x86 ............................ AES F16C RDRAND SHA
  Build parts ............................ libs tools
  App store compliance ................... no
Qt modules and options:
  Qt Concurrent .......................... yes
  Qt D-Bus ............................... no
  Qt D-Bus directly linked to libdbus .... no
  Qt Gui ................................. yes
  Qt Network ............................. yes
  Qt Sql ................................. yes
  Qt Testlib ............................. yes
  Qt Widgets ............................. yes
  Qt Xml ................................. yes
Support enabled for:
  Using pkg-config ....................... no
  udev ................................... no
  Using system zlib ...................... yes
  Zstandard support ...................... yes
Qt Core:
  DoubleConversion ....................... yes
    Using system DoubleConversion ........ yes
  GLib ................................... no
  iconv .................................. no
  ICU .................................... no
  Built-in copy of the MIME database ..... yes
  Tracing backend ........................ <none>
  Logging backends:
    journald ............................. no
    syslog ............................... no
    slog2 ................................ no
  PCRE2 .................................. yes
    Using system PCRE2 ................... yes
Qt Network:
  getifaddrs() ........................... no
  IPv6 ifname ............................ no
  libproxy ............................... no
  Schannel ............................... no
  OpenSSL ................................ yes
    Qt directly linked to OpenSSL ........ yes
  OpenSSL 1.1 ............................ yes
  DTLS ................................... yes
  OCSP-stapling .......................... yes
  SCTP ................................... no
  Use system proxies ..................... yes
  GSSAPI ................................. no
Qt Gui:
  Accessibility .......................... yes
  FreeType ............................... yes
    Using system FreeType ................ yes
  HarfBuzz ............................... no
    Using system HarfBuzz ................ no
  Fontconfig ............................. no
  Image formats:
    GIF .................................. yes
    ICO .................................. yes
    JPEG ................................. yes
      Using system libjpeg ............... yes
    PNG .................................. yes
      Using system libpng ................ no
  Text formats:
    HtmlParser ........................... yes
    CssParser ............................ yes
    OdfWriter ............................ yes
    MarkdownReader ....................... yes
      Using system libmd4c ............... yes
    MarkdownWriter ....................... yes
  EGL .................................... yes
  OpenVG ................................. no
  OpenGL:
    ANGLE ................................ yes
    Combined ANGLE Library ............... no
    Desktop OpenGL ....................... no
    Dynamic OpenGL ....................... yes
    OpenGL ES 2.0 ........................ no
    OpenGL ES 3.0 ........................ no
    OpenGL ES 3.1 ........................ no
    OpenGL ES 3.2 ........................ no
  Vulkan ................................. no
  Session Management ..................... yes
Features used by QPA backends:
  evdev .................................. no
  libinput ............................... no
  INTEGRITY HID .......................... no
  mtdev .................................. no
  tslib .................................. no
  xkbcommon .............................. no
  X11 specific:
    XLib ................................. no
    XCB Xlib ............................. no
    EGL on X11 ........................... no
    xkbcommon-x11 ........................ no
QPA backends:
  DirectFB ............................... no
  EGLFS .................................. no
  LinuxFB ................................ no
  VNC .................................... no
  Windows:
    Direct 2D ............................ yes
    DirectWrite .......................... yes
    DirectWrite 2 ........................ yes
Qt Sql:
  SQL item models ........................ yes
Qt Widgets:
  GTK+ ................................... no
  Styles ................................. Fusion Windows WindowsVista
Qt PrintSupport:
  CUPS ................................... no
Qt Sql Drivers:
  DB2 (IBM) .............................. no
  InterBase .............................. no
  MySql .................................. no
  OCI (Oracle) ........................... no
  ODBC ................................... yes
  PostgreSQL ............................. yes
  SQLite2 ................................ no
  SQLite ................................. yes
    Using system provided SQLite ......... yes
  TDS (Sybase) ........................... no
Qt Testlib:
  Tester for item models ................. yes
Qt QML:
  QML network support .................... yes
  QML debugging and profiling support .... yes
  QML just-in-time compiler .............. yes
  QML sequence object .................... yes
  QML XML http request ................... yes
  QML Locale ............................. yes
Qt QML Models:
  QML list model ......................... yes
  QML delegate model ..................... yes
Qt Quick:
  Direct3D 12 ............................ yes
  AnimatedImage item ..................... yes
  Canvas item ............................ yes
  Support for Qt Quick Designer .......... yes
  Flipable item .......................... yes
  GridView item .......................... yes
  ListView item .......................... yes
  TableView item ......................... yes
  Path support ........................... yes
  PathView item .......................... yes
  Positioner items ....................... yes
  Repeater item .......................... yes
  ShaderEffect item ...................... yes
  Sprite item ............................ yes
Qt Quick Controls 2:
  Styles ................................. Default Fusion Imagine Material Universal
Qt Quick Templates 2:
  Hover support .......................... yes
  Multi-touch support .................... yes
Qt Multimedia:
  ALSA ................................... no
  GStreamer 1.0 .......................... no
  GStreamer 0.10 ......................... no
  Video for Linux ........................ no
  OpenAL ................................. yes
  PulseAudio ............................. no
  Resource Policy (libresourceqt5) ....... no
  Windows Audio Services ................. yes
  DirectShow ............................. yes
  Windows Media Foundation ............... yes
Qt Tools:
  Qt Assistant ........................... yes
  Qt Designer ............................ yes
  Qt Distance Field Generator ............ yes
  kmap2qmap .............................. yes
  Qt Linguist ............................ yes
  Mac Deployment Tool .................... no
  makeqpf ................................ yes
  pixeltool .............................. yes
  qdbus .................................. yes
  qev .................................... yes
  Qt Attributions Scanner ................ yes
  qtdiag ................................. yes
  qtpaths ................................ yes
  qtplugininfo ........................... yes
  Windows deployment tool ................ yes
  WinRT Runner Tool ...................... no
Qt Tools:
  QDoc ................................... yes

Note: Using static linking will disable the use of dynamically
loaded plugins. Make sure to import all needed static plugins,
or compile needed modules into the library.

ERROR: Feature 'system-png' was enabled, but the pre-condition 'features.png && libs.libpng' failed.

qt/5.15.11: ERROR:
Package '020a7cd993e36db783fa98d5d067f534b330337c' build failed
qt/5.15.11: WARN: Build folder C:\Users\xxx\.conan2\p\b\qt66c5d7da4619d\b
ERROR: qt/5.15.11: Error in build() method, line 843
        self.run("%s %s" % (os.path.join(self.source_folder, "qt5", "configure"), " ".join(args)))
        ConanException: Error 3 while executing

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded
Copy link
Member

Hi @CheerThe2nd

Thanks for your question are your details to explain it.
I am trying to reproduce here.
The first thing to consider is that that specific qt 5.15.11 is no longer maintained or supported in ConanCenter, if you check https://github.com/conan-io/conan-center-index/blob/master/recipes/qt/5.x.x/conandata.yml, you will see that the only version remaining there is 5.15.14.

It can happen that ConanCenter still contains the older versions uploaded, but they are not in source anymore. To build missing binaries, it would always be recommended try to build at least the latest patch version.

So the first thing I'd try is using 5.15.14 instead, please try that and let us know. Thanks!

@CheerThe2nd
Copy link
Author

Hello @memsharded,
I will try this later when I am back home and let you know how it goes. But what if I wanted/needed to use qwt/6.2.0 which depence on qt/5.15.11. Does that mean I have to force it or how should I handle this.

@CheerThe2nd
Copy link
Author

@memsharded I tried it with qt/5.15.14 but the error as before occurred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants