Tag Archives: qtcreator

JOM error 2 problem when qtcreator uses cmake to build a project

When qtcreator uses the MSVC compilation environment to build a project, a JOM: C: /… /… [cmtc_fe41e \ fast] error 2 error will occur due to incorrect configuration. Here are my solutions and understanding of this problem. I hope it can help small partners who encounter the same problem.

Error screenshot

Error reason

When qtcreator uses cmake to build a project, it will first test the environment configuration. If you have used cmake GUI or the command line to generate the corresponding project file (vs. vcxproj or Makefile, etc.) through cmakelists.txt, you will understand this process. Cmake uses the – g parameter to see which specific projects are supported, called cmake generators.

Cmake command line generates makefiles:
MD build
CD build
cmake – G “nmake makefiles JOM”…
#[[
… Indicates that cmakelists.txt is placed in the upper level directory. In this step, cmake will automatically detect the environment. If an error occurs, you cannot generate project files or makefiles
#]]
nmake

Cmake GUI: after setting, click Configure to generate if there is no problem

so the JOM error above is that cmake detects that the environment configuration is incorrect. At this time, you will see that qtcreator will not load the source file at all. Only one cmakelists.txt

open cmake’s error log file, and you will find that some tools needed in the construction process cannot be found:

“D:\Program Files (x86)\CMake\bin\cmake.exe” -E vs_ link_ exe
–intdir=CMakeFiles\cmTC_ 5b162.dir
–rc=rc
–mt=CMAKE_ MT-NOTFOUND
–manifests
– D:\PROGRA1\MICROS1.0\VC\bin\amd64\link.exe /nologo @CMakeFiles\cmTC_ 5b162.dir\objects1.rsp @C:\Users\ADMINI~1\AppData\Local\Temp\cmTC_ 5b162.exe.9516.577.jom

RC pass 1: command “RC/fo cmakefiles \ cmtc_5b162. Dir/manifest. Res cmakefiles \ cmtc_5b162. Dir/manifest. RC” failed (exit code 0) with the following output:
the system cannot find the specified file. jom: C:\Users\Administrator\AppData\Local\Temp\QtCreator-liCfaX\qtc-cmake-pToFXfXx\CMakeFiles\CMakeTmp\CMakeFiles\cmTC_ 5b162.dir\build.make [cmTC_5b162.exe] Error 2

jom: C:\Users\Administrator\AppData\Local\Temp\QtCreator-liCfaX\qtc-cmake-pToFXfXx\CMakeFiles\CMakeTmp\Makefile [cmTC_5b162\fast] Error 2

RC is rc.exe, and the resource compiler
MT is mt.exe

resolvent

It’s easy to know the cause of the error

First, add the path of jom.exe to the environment variable path
${QT installation directory} \ tools \ qtcreator \ bin

Then add the paths of rc.exe and mt.exe to the environment variable path
C: \ program files (x86) \ windows kits \ 10 \ bin \ 10.0.17763.0 \ x86
depending on the system version and 32-bit/64 bit, find out for yourself

When there are no problems, you can build the project

QT encountered in CentOS installation( qt.qpa.plugin : Could not load the Qt platform plugin “xcb” )

I don’t believe it. How hard is it to install Qt on Linux?I reinstalled the system several times and got drunk. Here are the problems I encountered:
Round1:
After installation, execute the QTCreator prompt:
Linux qt “qt.qpa.plugin: Could not load the Qt platform plugin “xcb” ”

sudo gedit ~/.bashrc
sudo gedit ~/.bashrc
sudo gedit ~/.bashrc

export QT_DEBUG_PLUGINS=1
export LD_LIBRARY_PATH=/opt/Qt5.13.1/5.13.1/gcc_64/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/Qt5.13.1/Tools/QtCreator/lib:$LD_LIBRARY_PATH

The last two sentences are from the link library path added to the search path, do not know whether to work.
Emphasized in fact the first sentence here, and after the configuration items, QtCreator will output a lot of information, so we can be targeted, step by step to solve the problem/
the changes to take effect

sudo source  ~/.bashrc

round2:
Execute the QtCreator program again from the command line, and output a bunch of log information. Skip to the end to find a prompt:
always load the library/opt/Qt5.13.1/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb. So: (libxkbcommon – x11. So. 0: unable to open the Shared object file: Don’t have that file or directory)
QLibraryPrivate: : loadPlugin failed on “/ opt/Qt5.13.1/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb. So” : “Always load the library/opt/Qt5.13.1/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb. So: (libxkbcommon – x11. So. 0: unable to open the Shared object file: no files or directories)”

obviously failure load of dynamic link library, first check whether there is the file exists, then look at whether the dependent libraries are able to find success:

ldd  /opt/Qt5.13.1/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so

Libxkbcommon is not available, you need to install the library, use yum to install:

yum -y install libxkbcommon-x11-devel

Round 3 lacks DBUS
If you continue, there is still an error. If you skip to the last line, there is still an error
/ opt/Qt5.13.1/Tools/QtCreator/bin/QtCreator: relocation error:/opt/Qt5.13.1/Tools/QtCreator/lib/Qt/plugins/platforms /.. /.. /lib/ libqt5dbus.so.5: Symbol dbus_message_set_allow_interactive_authorization, version LIBDBUS_1_3 not defined in file libbus-1.so.3 with link time reference

yum -y install dbus-devel

round4
Continue with the following error
Opt/Qt5.13.1/Tools/QtCreator/bin/QtCreator: symbol lookup error:/opt/Qt5.13.1/Tools/QtCreator/lib/Qt/plugins/platforms /.. /.. /lib/ libqt5xcbqpa.so.5: undefined Symbol: FT_GET_FONT_FORMAT

yum -y install freetype-devel

Export QT_DEBUG_PLUGINS=1. You may not have the same problem as me, but with the output, you can solve it step by step.