ROS2 building on Windows 10 Could NOT find TinyXML2 (missing: TINYXML2_LIBRARY TINYXML2_INCLUDE_DIR)
I am receiving the following error:
CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
Could NOT find TinyXML2 (missing: TINYXML2_LIBRARY TINYXML2_INCLUDE_DIR)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindTinyXML2.cmake:24 (find_package_handle_standard_args)
CMakeLists.txt:6 (find_package)
I am tracking this down and have found a couple of interesting things. One of these me to the the Troubleshooting section https://index.ros.org/doc/ros2/Troubleshooting/#windows-troubleshooting, which states:
CMake packages unable to find asio, tinyxml2, tinyxml, eigen, or log4cxx¶ We’ve seen that sometimes the chocolatey packages for asio, tinyxml2, etc. do not add important registry entries and CMake will be unable to find them when building ROS 2. We’ve not yet been able to identify the root cause, but uninstalling the chocolatey packages (with -n if the uninstall fails the first time), and then reinstalling them will fix the issue.
I have tried the above and a ton of other things: Setting ENV vars, changing the *.in files, and some more shots in the dark.
Thought that maybe it was picking up the wrong python, as visual studio has it's own version laying around. As per the instruction, I did install python 3.7.5 in c:\Python37, updated that PATH, and verified with the following:
C:\dev\ros2_eloquent>python --version
Python 3.7.5
Not really sure of what the next step is.
which ros2 packages are you buiding? I had the same issue but I fixed it. It really depends on the ros2 package's cmake usage of tinyxml2. BTW, the way of installation of your tinyxml2 also matters.