Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to configure QtCharts withint CMakelist.txt

How to configure QtCharts withint CMakelist.txt

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 7.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lingfeng
    wrote on last edited by
    #1

    Hi
    There is a fetal error "QtCharts/QChartView: No such file or directory" when running make.
    I tried to add Charts to qt5_use_modules, but it reports no such module.
    Any other feature works fine in my cmake project. My Qt version is 5.9.1. OS is ubuntu 16.04.

    Please Help.

    Best Regards,

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      QtCharts is an add-on module. Probably you forgot installing it.

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mchinand
        wrote on last edited by
        #3

        What version of CMake do you have? Something like this should work if you installed the QtCharts add-on and have a recent version of CMake

        ...
        # include other modules above
        find_package(Qt5Charts)
        .
        .
        .
        add_executable(myapp main.cpp)
        # Use the Widgets and Charts modules from Qt 5.
        target_link_libraries(myapp Qt5::Widgets Qt5::Charts)
        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved