Tag Archives: cmake

launch file Run Error: Resourcenotfound: XXX [How to Solve]

launch File run Error:

Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 308, in main
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py", line 268, in start
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py", line 217, in _start_infrastructure
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py", line 132, in _load_config
    roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/config.py", line 451, in load_config_default
    loader.load(f, config, verbose=verbose)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 750, in load
    self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 722, in _load_launch
    self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 686, in _recurse_load
    val = self._include_tag(tag, context, ros_config, default_machine, is_core, verbose)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 95, in call
    return f(*args, **kwds)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 589, in _include_tag
    inc_filename = self.resolve_args(tag.attributes['file'].value, context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 183, in resolve_args
    return substitution_args.resolve_args(args, context=context.resolve_dict, resolve_anon=self.resolve_anon)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 370, in resolve_args
    resolved = _resolve_args(resolved, context, resolve_anon, commands)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 383, in _resolve_args
    resolved = commands[command](resolved, a, args, context)
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 151, in _find
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 197, in _find_executable
    full_path = _get_executable_path(rp.get_path(args[0]), path)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 207, in get_path
    raise ResourceNotFound(name, ros_paths=self._ros_paths)
ResourceNotFound: lslidar_c16_decoder
ROS path [0]=/opt/ros/kinetic/share/ros
ROS path [1]=/home/lskk/lego_loam_ws/src
ROS path [2]=/opt/ros/kinetic/share



For ResourceNotFound: xxx class issues. If it is an installation package, perform the corresponding installation; for this error, the file is not found, check the lslidar_c16_decoder item in launch and modify it.


[Solved] ubuntu makefile Cross-compilation error: file not recognized: file format not recognized

When compiling netkit-ftp on linux ubuntu an error is reported: file not recognized: file format not recognized

[[email protected] /arnold_test/20211219_ftpCrossCompile/netkit-ftp-0.17]24# make
(cd  ftp && make)
make[1]: Entering directory '/arnold_test/20211219_ftpCrossCompile/netkit-ftp-0.17/ftp'
arm-linux-gnueabihf-gcc -O2 -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline  glob.c -c
arm-linux-gnueabihf-gcc -O2 -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline  main.c -c
arm-linux-gnueabihf-gcc -O2 -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline  ruserpass.c -c
arm-linux-gnueabihf-gcc  cmds.o cmdtab.o domacro.o ftp.o glob.o main.o ruserpass.o  -o ftp
cmds.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
Makefile:14: recipe for target 'ftp' failed
make[1]: *** [ftp] Error 1
make[1]: Leaving directory '/arnold_test/20211219_ftpCrossCompile/netkit-ftp-0.17/ftp'
Makefile:7: recipe for target 'ftp.build' failed
make: *** [ftp.build] Error 2

Solution: make clean

Or manually delete the files generated by the previous compilation

[Solved] QT cmak Compile Error: CMake Error: The source.. does not match the soused

**Cmake error: the source… Does not match the used to generate cache Re-run cmake…

Delete the CMakeLists.txt.user file in the project.

problem is solved. Later, it is found that the file is also a cache file, which contains the compilation status information of the project before, such as the debug directory. In cmake, if there is this file, the compiler will use the relevant cache information in this file, so various errors will occur:

delete the file and restart cmake, A new file is regenerated.

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

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
– 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


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

[Solved] Mac Cmake Complie openmp Error: fatal error: ‘omp.h‘ file not found

Mac OS 11.5.2, cmake default compiler appleclang 12.0.5

Make keeps reporting errors after compiling

fatal error: 'omp.h' file not found

The reason is that a.cpp file introduces OpenMP, OMP.H

It can be compiled successfully through G + +, but the make default clang compilation in MAcc is not successful. In other words, it cannot be compiled through cmake on Mac

Try to resolve:

Adding before the project line of cmake has no effect

SET(CMAKE_C_COMPILER "/usr/bin/gcc")
SET(CMAKE_CXX_COMPILER "/usr/bin/g++")

On the command line, the export cxx = “usr/bin/G + +” variable also has no effect


Brew install libomp

brew install libomp

Change the path corresponding to OMP. H where. CPP introduces OMP. H


[Solved] CMake Error: Could not create named generator Visual Studio 16 2019

Cmake error: could not create named generator visual studio 16 2019

When running the demo in openvino, this bug is always prompted. According to the suggestions of stackoverflow and official documents, use cmake - G "Visual Studio 16 2019" - a x64 this command to compile, which is also invalid. Later, after troubleshooting, I thought it might be the problem of cmake version. Because the old version of cmake (before 3.14) may not find the latest visual studio, I went to the official website to download it, Run the. Bat file in the demo to solve the problem

How to Solve Msys2/mingw64 Run cmake GUI Error

August 24, 2021
It has been updated to the latest version.

$ cmake-gui –version
cmake version 3.21.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).

But still error as below:

$ cmake-gui
C:/msys64/mingw64/bin/cmake-gui.exe: error while loading shared libraries: zlib1.dll: cannot open shared object file: No such file or directory

Finally found that the installation of qt5 can be solved

pacman -S mingw-w64-x86_64-qt5
resolving dependencies…
looking for conflicting packages…
Packages (16) mingw-w64-x86_64-assimp-5.0.1-11  mingw-w64-x86_64-dbus-1.12.20-3  mingw-w64-x86_64-double-conversion-3.1.5-1  mingw-w64-x86_64-icu-debug-libs-68.2-3  mingw-w64-x86_64-libgcrypt-1.9.2-2
mingw-w64-x86_64-libgpg-error-1.42-1  mingw-w64-x86_64-libmng-2.0.3-4  mingw-w64-x86_64-libmysofa-1.2-1  mingw-w64-x86_64-libxslt-1.1.34-4  mingw-w64-x86_64-minizip-git-1.2.445.e67b996-2  mingw-w64-x86_64-openal-1.21.1-2
mingw-w64-x86_64-pcre2-10.36-1  mingw-w64-x86_64-qtbinpatcher-2.2.0-4  mingw-w64-x86_64-xpm-nox-4.2.0-6  mingw-w64-x86_64-z3-4.8.9-2  mingw-w64-x86_64-qt5-5.15.2-10
Total Download Size:   223.16 MiB
Total Installed Size:  873.75 MiB

then re-run:


You will be able to value the dialog box of the gui pop-up!

[Solved] OpenGL PowerVR SDK Compiling Error: Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB)

Project scenario:

Compiling powervr SDK

Problem Description:

In the process of cmake powervr SDK, the error message is as follows:

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindX11.cmake:366 (find_package_handle_standard_args)
  framework/PVRShell/CMakeLists.txt:92 (find_package)

-- Configuring incomplete, errors occurred!
See also "/mnt/f/CG21S/Native_SDK-R21.1-v5.7/build/CMakeFiles/CMakeOutput.log".
See also "/mnt/f/CG21S/Native_SDK-R21.1-v5.7/build/CMakeFiles/CMakeError.log

Cause analysis:

Search for could not find X11 (missing: X11)_ X11_ INCLUDE_ PATH X11_ X11_ The following blog posts were obtained:
in this study, we found that https://blog.csdn.net/quantum7/article/details/93484972
Indicates that xtest. H is missing


After testing, the following codes are valid:

sudo apt-get install libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev

[Solved] Denseflow Install Error: fatal error: opencv2/cudaarithm.hpp: No such file or directory

Installing denseflow compiles with the following error./home/m/src/denseflow/src/denseflow_gpu.cpp:2:10: fatal error: opencv2/cudaarithm.hpp: No such file or directory
#include “opencv2/cudaarithm.hpp”
where the keywords are
The solution is as follows.
1、Find the path where cudaarithm.hpp is located

sudo find/-name "cudaarithm.hpp"

A path similar to:


Then fill the absolute path into denseflow_ Gpu.cpp replaces relative path

#You have to fill in the absolute paths, and our paths may be different, you have to follow your own
sudo vim /home/m/src/denseflow/src/denseflow_gpu.cpp

Before replacing
#include “opencv2/cudaarithm.hpp”
After replacement
#include “/home/m/include/opencv4/opencv2/cudaarithm.hpp”
Compile again, the problem is solved.