Compiling QtCreator 5.0 from source
-
Hi, I need help.
I am trying to compile Qt Creator from source according to this instruction: https://github.com/qt-creator/qt-creatormkdir qtcreator_build cd qtcreator_build cmake -DCMAKE_BUILD_TYPE=Release -G Ninja -DPYTHON_EXECUTABLE=/usr/bin/python3 '../qt-creator'
The result is an error:
CMake Warning (dev) at /usr/local/share/cmake-3.21/Modules/GNUInstallDirs.cmake:236 (message): Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. Please enable at least one language before including GNUInstallDirs. Call Stack (most recent call first): cmake/QtCreatorAPIInternal.cmake:69 (include) cmake/QtCreatorAPI.cmake:8 (include) CMakeLists.txt:10 (include) This warning is for project developers. Use -Wno-dev to suppress it. -- The C compiler identification is GNU 10.3.0 -- The CXX compiler identification is GNU 10.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- 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 -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE CMake Error at cmake/QtCreatorAPI.cmake:401 (get_property): get_property could not find TARGET Designer. Perhaps it has not yet been created. Call Stack (most recent call first): src/plugins/mesonprojectmanager/CMakeLists.txt:1 (add_qtc_plugin) CMake Error at cmake/QtCreatorAPI.cmake:401 (get_property): get_property could not find TARGET Designer. Perhaps it has not yet been created. Call Stack (most recent call first): src/plugins/qmakeprojectmanager/CMakeLists.txt:1 (add_qtc_plugin) CMake Error at cmake/QtCreatorAPI.cmake:401 (get_property): get_property could not find TARGET Designer. Perhaps it has not yet been created. Call Stack (most recent call first): src/plugins/cmakeprojectmanager/CMakeLists.txt:1 (add_qtc_plugin) CMake Error at src/plugins/qmlpreview/CMakeLists.txt:28 (get_target_property): get_target_property() called with non-existent target "Qt5::QmlPrivate". -- Found PythonInterp: /usr/bin/python3 (found version "3.8.6") CMake Warning at cmake/QtCreatorTranslations.cmake:100 (message): No Qt translation tools found, skipping translation targets. Add find_package(Qt5 COMPONENTS LinguistTools) to CMake to enable. Call Stack (most recent call first): share/qtcreator/translations/CMakeLists.txt:47 (add_translation_targets) -- The following packages have been found: * Qt5Concurrent * Qt5Gui * Qt5Network * Qt5PrintSupport * Qt5Qml * Qt5QmlModels (required version >= 5.14.2) * Qt5Quick * Qt5QuickWidgets * Qt5Sql * Qt5Widgets * Qt5Xml * Qt5SerialPort * Threads * LLVM * Clang * Qt5Test * yaml-cpp, using internal src/libs/3rdparty/yaml-cpp * Qt5Core * Qt5 * PythonInterp -- The following packages have not been found: * Qt5LinguistTools * Qt5Designer * Qt5DesignerComponents * Qt5Help * Qt5Svg * KF5SyntaxHighlighting * Qt5SvgWidgets * Qt5WebEngineWidgets -- The following features have been enabled: * Library 3rd_cplusplus * Library KSyntaxHighlighting * Library AdvancedDockingSystem * Library Aggregation * Library ExtensionSystem * Library Utils * Library LanguageUtils * Library CPlusPlus * Library Modeling * Library QmlJS * Library QmlDebug * Library QmlEditorWidgets * Library GLSL * Library LanguageServerProtocol * Library QtcSsh * Library Sqlite * Library ClangSupport * Library Tracing * Library ProParser * Plugin Core * Plugin TextEditor * Plugin SerialTerminal, with CONDITION TARGET Qt5::SerialPort * Plugin HelloWorld * Plugin ImageViewer * Plugin Marketplace * Plugin UpdateInfo * Plugin Welcome * Plugin BinEditor * Plugin CodePaster * Plugin DiffEditor * Plugin EmacsKeys * Plugin Macros * Plugin ProjectExplorer * Plugin SilverSearcher * Plugin Bookmarks * Plugin CppTools * Plugin ResourceEditor * Plugin TaskList * Plugin Nim * Plugin Conan * Plugin ClassView * Plugin CppEditor * Plugin GLSLEditor * Plugin ModelEditor * Plugin QtSupport * Plugin Todo * Plugin VcsBase * Plugin Bazaar * Plugin Beautifier * Plugin ClangFormat, with CONDITION TARGET libclang AND LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL 10.0.0 AND QTC_CLANG_BUILDMODE_MATCH * Plugin ClearCase * Plugin CVS * Plugin Docker * Plugin FakeVim * Plugin GenericProjectManager * Plugin Git * Plugin Mercurial * Plugin MesonProjectManager * Plugin Perforce * Plugin QmakeProjectManager * Plugin QmlJSTools * Plugin QmlProjectManager * Plugin ScxmlEditor * Plugin Subversion * Plugin CompilationDatabaseProjectManager * Plugin LanguageClient * Plugin StudioWelcome * Plugin CMakeProjectManager * Plugin Debugger * Plugin Android * Plugin AutoTest * Plugin AutotoolsProjectManager * Plugin BareMetal * Plugin ClangCodeModel, with CONDITION TARGET libclang * Library yaml-cpp * Plugin ClangTools, with CONDITION TARGET yaml-cpp * Plugin Cppcheck * Plugin IncrediBuild * Plugin Ios * Plugin Python * Plugin QmlJSEditor * Plugin QmlPreview * Plugin QmlProfiler, with CONDITION TARGET Tracing * Plugin RemoteLinux * Plugin Valgrind * Plugin WinRt * Plugin PerfProfiler, with CONDITION TARGET Tracing * Plugin QbsProjectManager * Plugin CtfVisualizer, with CONDITION TARGET Tracing * Plugin Boot2Qt * Plugin QmlDesigner * Plugin assetexporterplugin, with CONDITION TARGET QmlDesigner * Plugin componentsplugin, with CONDITION TARGET QmlDesigner * Plugin qmlpreviewplugin, with CONDITION TARGET QmlDesigner * Plugin qtquickplugin, with CONDITION TARGET QmlDesigner * Plugin Qnx * Plugin WebAssembly * Plugin McuSupport * Library clangbackend_lib * Library qml2puppet_static -- The following features have been disabled: * Build documentation * Build online documentation * Build tests * Build with Crashpad * Library Minitrace * Build Qbs, with CONDITION TARGET Qt5::Script * Plugin Help, with CONDITION TARGET Qt5::Help * Plugin Designer, with CONDITION TARGET Qt5::DesignerComponents AND TARGET Qt5::Designer * Qt Quick 3D support, with CONDITION TARGET Qt5::Quick3D * Qt Quick 3D asset import, with CONDITION TARGET Qt5::Quick3DAssetImport * multilanguage-support in qml2puppet, with CONDITION TARGET QtCreator::multilanguage-support * Include developer documentation -- Configuring incomplete, errors occurred! See also "/Project/qt-creator/qt-creator-build/CMakeFiles/CMakeOutput.log". See also "/Project/qt-creator/qt-creator-build/CMakeFiles/CMakeError.log".
-
Hi and welcome to devnet,
Which version of Qt are you using ?
How did you install it ? -
For the prefix path I usually point it to the cmake folder in the libs folder of the Qt installation I want to use.
-
Hello!
I had the same issue with pthread.h on
Windows
. So, I reported it here: https://bugreports.qt.io/browse/QTCREATORBUG-27158
Thanks to Eike Ziller, I know how to fix this issue with pthread.h, which is not required on Windows.
So, to fix this issue and compile Qt Creator successfully, you must add the following commands:-DBUILD_EXECUTABLE_QML2PUPPET=OFF -DBUILD_LIBRARY_QML2PUPPET_STATIC=OFF
to disable some plugins.For example, I run these commands using
x64 Native Tools Command Prompt for VS 2019/2022
to builtQt Creator 7
usingQt 5.15.2
:cmake -DCMAKE_BUILD_TYPE=Release -G Ninja "-DCMAKE_PREFIX_PATH=C:/Qt/5.15.2/msvc2019_64;C:/LLVM" -DBUILD_EXECUTABLE_QML2PUPPET=OFF -DBUILD_LIBRARY_QML2PUPPET_STATIC=OFF C:/Users/cobra/Downloads/qt-creator-opensource-src-7.0.0-rc1 cmake --build . cmake --install . --prefix C:/Qt/qtcreator-7.0.0-rc1 cmake --install . --prefix C:/Qt/qtcreator-7.0.0-rc1 --component Dependencies
Note: Using forward slashes for paths in
CMAKE_PREFIX_PATH
is usually the safer way even onWindows
.
The last 2 commands is required. It will install all the necessaryQt Creator
components in following directory:C:/Qt/qtcreator-7.0.0-rc1
Screenshot:
-
@SGaist I had the same error
As a result, compiled by make with fix some errors.
Create qt creator build dir
Go to this dir
and run /Path_to_Qt_lib_build/bin/qmake -o Makefile /Path_to_Qt_creator_src/qtcreator.pro
Make file will be created.
run make -j $(nproc) from this dir
or simple make
Then fix errors and run make again -
Plugin Designer, with CONDITION TARGET Qt5::DesignerComponents AND TARGET Qt5::Designer
- Qt Quick 3D support, with CONDITION TARGET Qt5::Quick3D
- Qt Quick 3D asset import, with CONDITION TARGET Qt5::Quick3DAssetImport
- multilanguage-support in qml2puppet, with CONDITION TARGET QtCreator::multilanguage-support
- Include developer documentation
You could not build plugin Designer for Design mode and this gave this error.
-
In my case it had not qttools package in qt build library.
I build qt lib from sources.