Building QT Creator from source fails
-
Hello,
I would like to design some Qt Creator plugins to generate a few reusable widgets.
As far as I have understood, I need to build the QT Creator from source to be able to build and integrate those plugins.
(Correct me if that is already wrong ..?)So I have tried to follow the instructions describing the compilation process: qt-creator.README
-
I've cloned the creator repository inside C:\dev\src\qt-creator
-
I've downloaded via the installer:
2.1) Qt6.3.0 MinGW11.2.0 x64 binaries
2.2) Qt6.3.0 Qt5 Compatibility module
2.3) MinGW 11.2.0 x64 toolchain with gcc 11.2.0 -
I've downloaded libclang-release_130-based-windows-mingw_64, CMake, ninja and Python3.10.
All the paths are set (I checked with CMake -help etc. in an empty console window)
After that I've created the build directory and ran inside:
cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja "-DCMAKE_PREFIX_PATH=C:\dev\Qt\6.3.0\mingw_64; C:\dev\LLVM_Clang\libclang-release_130-based-windows-mingw_64\libclang" C:\dev\src\qt-creator
The configuration finishes and I am told to run
cmake --build .
The build process starts and tons of files get processed until it stops with the following error message:
FAILED: bin/sdktool.exe cmd.exe /C "cd . && C:\dev\Qt\Tools\mingw1120_64\bin\c++.exe -g src/tools/sdktool/CMakeFiles/sdktool.dir/sdktool_autogen/mocs_compilation.cpp.obj src/tools/sdktool/CMakeFiles/sdktool.dir/main.cpp.obj -o bin\sdktool.exe -Wl,--out-implib,src\tools\sdktool\libsdktool.dll.a -Wl,--major-image-version,0,--minor-image-version,0 bin/libsdktoolLib.a C:/dev/Qt/6.3.0/mingw_64/lib/libQt6Core.a -lmpr -luserenv -luser32 -liphlpapi -lws2_32 -lshell32 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ." C:/dev/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/tools/sdktool/CMakeFiles/sdktool.dir/main.cpp.obj: in function `printHelp(std::vector<std::unique_ptr<Operation, std::default_delete<Operation> >, std::allocator<std::unique_ptr<Operation, std::default_delete<Operation> > > > const&)': C:/dev/src/qt-creator/src/tools/sdktool/main.cpp:84: undefined reference to `__imp__ZN5Utils8FilePath10fromStringERK7QString' C:/dev/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/dev/src/qt-creator/src/tools/sdktool/main.cpp:84: undefined reference to `__imp__ZNK5Utils8FilePath12pathAppendedERK7QString' C:/dev/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/dev/src/qt-creator/src/tools/sdktool/main.cpp:84: undefined reference to `__imp__ZNK5Utils8FilePath12toUserOutputEv' C:/dev/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/tools/sdktool/CMakeFiles/sdktool.dir/main.cpp.obj: in function `parseArguments(QList<QString> const&, Settings*, std::vector<std::unique_ptr<Operation, std::default_delete<Operation> >, std::allocator<std::unique_ptr<Operation, std::default_delete<Operation> > > > const&)': C:/dev/src/qt-creator/src/tools/sdktool/main.cpp:129: undefined reference to `__imp__ZN5Utils8FilePath10fromStringERK7QString' C:/dev/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/dev/src/qt-creator/src/tools/sdktool/main.cpp:138: undefined reference to `__imp__ZN5Utils8FilePath10fromStringERK7QString' collect2.exe: error: ld returned 1 exit status [253/2155] Linking CXX shared library lib\qtcreator\plugins\libProjectExplorer.dll ninja: build stopped: subcommand failed.
To be honest - I am kind of lost here and do not know what to do with this error message.
If you've got some hints on how to solve this mess I would really appreciate it.Thank you!
-
-
@unzu said in Building QT Creator from source fails:
As far as I have understood, I need to build the QT Creator from source to be able to build and integrate those plugins.
(Correct me if that is already wrong ..?)No need!
You just need to build your plugins using a compiler and a Qt version that are compatible with the ones used to build Qt Creator. See "Help" > "About Qt Creator..." for the details.
-
@unzu said in Building QT Creator from source fails:
when I create one of those plugin projects via the manager I need to specify the build directory of the qtCreator. It is looking for some cmake file in there it appears..?
The CMakeLists.txt file is part of your source code.
You specify the directory to tell CMake where to install your plugin after building is complete.
-
@JKSH I am not talking about the CMakeLists of the Plugin project, just to make sure.
When trying to compile there is an error in the "CMake-Step". It says that it could not find FindQtCreator.cmake or something like that.
However, I was not using the proper compiler - I tried to compile it with MingW while QtCreator is compiled with MSVC (I think)
Sadly I haven't got access to my pc right now. I will try to compile the plugin with the proper compiler as soon as I can. Thank you! -
Update:
I have managed to build a widget plugin!
I copied the .dll (It was installed into the directory of the Qt binaries) to the plugins directory of the qt creator.
I am now able to drag 'n' drop my custom widget in my main application.
What I am still missing is how to properly integrate the plugin in my project - it is looking for the header files of the plugin etc when building my main project.Is there a CMake-Command to include the custom plugin that I need to add to my main project or how am I supposed to include the plugin?
Thanks again for your support and time!
-
@unzu said in Building QT Creator from source fails:
Update:
I have managed to build a widget plugin!
I copied the .dll (It was installed into the directory of the Qt binaries) to the plugins directory of the qt creator.
I am now able to drag 'n' drop my custom widget in my main application.Great!
What I am still missing is how to properly integrate the plugin in my project - it is looking for the header files of the plugin etc when building my main project.
Is there a CMake-Command to include the custom plugin that I need to add to my main project or how am I supposed to include the plugin?
Thanks again for your support and time!
I'm afraid I don't have experience with creating Qt Creator plugins.
Perhaps you can study an existing plugin, like Qwt's one: https://sourceforge.net/p/qwt/git/ci/develop/tree/designer/ (it uses qmake instead of CMake, but it should provide some clues)