Issue with QtCharts in Qt6.1.1
-
Don't build directly in the root of your sources. You should at least create a build folder and run cmake from there.
As for the error, pass the CMAKE_PREFIX_PATH pointing to where your Qt 6 cmake files are located.
-
Hello again,
I'm not terribly experienced in using CMake, so this is what I did, but unfortunately there are more errors:mkdir build
❯ build
❯ cmake -D CMAKE_PREFIX_PATH="~/Qt/6.1.1/clang_64/lib/cmake/Qt6" ..
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
-- Could NOT find Qt6CoreTools (missing: Qt6CoreTools_DIR)
CMake Warning at /Users/ryan/Qt/6.1.1/clang_64/lib/cmake/Qt6/Qt6Config.cmake:97 (find_package):
Found package configuration file:/Users/ryan/Qt/6.1.1/clang_64/lib/cmake/Qt6Core/Qt6CoreConfig.cmake
but it set Qt6Core_FOUND to FALSE so package "Qt6Core" is considered to be
NOT FOUND.
Call Stack (most recent call first):
CMakeLists.txt:16 (find_package)CMake Error at CMakeLists.txt:16 (find_package):
Found package configuration file:/Users/ryan/Qt/6.1.1/clang_64/lib/cmake/Qt6/Qt6Config.cmake
but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
FOUND. Reason given by package:Failed to find Qt component "Core" config file at ""
-- Configuring incomplete, errors occurred!
See also "/Users/ryan/Qt/6.1.1/Src/qtcharts/CMakeFiles/CMakeOutput.log".
See also "/Users/ryan/Qt/6.1.1/Src/qtcharts/CMakeFiles/CMakeError.log". -
I used cmake-gui, as suggested and manually set the Qt6*_DIR variables to the appropriate values (otherwise errors are produced as the directories aren't identified). The build process completes and installs properly, but I get the same errors when trying to compile my application.
I tried compiling an example that uses QtCharts (datetimeaxis), and that works. I do have some forms that use a QChartView widget. Since the errors are popping up in the generated ui_*.h files, do you think that this is somehow related?
-
How did you put the charts through designer ?
Using promotion ? -
Great !
Thanks for the feedback.
Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :-)