Closed LIU-Yinyi closed 8 months ago
The compilation error(s) you're getting are definitely only related to the GPDS dependency (https://github.com/simulton/gpds). Could you please share the version of GPDS you're using and which compiler you're using?
On a side note: I'll update the QSchematic readme to reflect the need for a C++20 compiler.
The compilation error(s) you're getting are definitely only related to the GPDS dependency (https://github.com/simulton/gpds). Could you please share the version of GPDS you're using and which compiler you're using?
On a side note: I'll update the QSchematic readme to reflect the need for a C++20 compiler.
Thanks for your prompt reply.
I enabled the option QSCHEMATIC_DEPENDENCY_GPDS_DOWNLOAD
and it was supposed to be the latest 1.8.1
version. It seems that no explicit definition about C++ standard version in the CMakeLists.txt
of GPDS project.
It seems that no explicit definition about C++ standard version in the
CMakeLists.txt
of GPDS project.
It's set as part of target_compile_features()
here: https://github.com/simulton/gpds/blob/42f7b76a42fdc7068ca779c6f5bed1593e08e1dc/lib/CMakeLists.txt#L48
This transitively makes it to consuming projects (such as QSchematic).
Therefore, consuming GPDS 1.8.1
will automatically set C++20 as the required standard in the QSchematic targets (via the generated gpds-targets.cmake
when consuming a GPDS installation and just via regular target properties when consuming a non-installed version).
Can you tell us exactly which compiler you're using?
Can you tell us exactly which compiler you're using?
>>> g++ --version
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
>>> cmake -B build
-- The CXX compiler identification is GNU 9.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Should I update it to a newer version?
AFAIK GCC only supports concepts starting with version 10: https://en.cppreference.com/w/cpp/compiler_support Personally, I know that the library works with GCC 12 and 13 (10 and 11 also used to work, but haven't tested that in a while).
AFAIK GCC only supports concepts starting with version 10: https://en.cppreference.com/w/cpp/compiler_support Personally, I know that the library works with GCC 12 and 13 (10 and 11 also used to work, but haven't tested that in a while).
Many thanks for your patience and guidance! @Tectu
For other developers who would encounter this problem, kindly update the version your gcc
and g++
to 10 or above:
# suppose developing on Ubuntu
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -y
sudo apt update
# the version can be 10/11/12/13
sudo apt install g++-10 gcc-10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
# update the priority of the gcc/g++ 10 or above
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
The problem has been resolved.
When I built the project following the document, the error as follows was triggered. My GCC version is 9.4.0 and it should support C++17 and C++20 according to the official documentation. Other mentioned dependencies such as QT5.15 and GPDS have already been installed.
requires
seems like a feature since C++20. I tried modifying theCMakeLists.txt
withinqschematic
to adapt to C++20 but this error still existed. Could you advise what action I should further do to solve this problem? Thank you.