Closed The-Lyc closed 2 days ago
This looks like some CMake paths aren't set up.
Did you source your /opt/ros/iron
workspace before beginning the build?
When you open your terminal try:
source /opt/ros/iron/setup.bash # or sh, zsh depending on shell
cd ~/my/ros/workspace
colcon build --symlink-install
@The-Lyc friendly ping. We need more information to be able to help you out here.
@mjcarroll Sorry for the delayed response, I didn't see your message earlier.
I tried to source /opt/ros/iron
workspace before beginning the build, but still met the same problem.
I successfully build humble version on the same environment before, can this cause my problem?
I successfully build humble version on the same environment before, can this cause my problem?
Yes, in general, you should not mix multiple distributions in the same environment. Perhaps try cleaning out any artifacts generated by the build (typically the log/
install/
and build/
directories), and see if that helps.
@mjcarroll thanku very much.
I deleted all the build artifacts, but the issue still occurred.
After reinstalling the environment, I was able to compile successfully. It seems that in the original environment, simply deleting the build artifacts and running the commands source /opt/ros/iron/setup.bash
did not completely eliminate the influence of the previously successfully compiled Humble.
Is there any method to completely remove a successfully compiled ROS 2 version?
It's likely that there were additional paths added to environment variables such as PATH
, LD_LIBRARY_PATH
, etc. These can be manually cleaned, but the the fastest way is simply to close the terminal and start a new one that hasn't been updated by the setup.sh
scripts.
@mjcarroll thanku.
colcon build --symlink-install, building from source code(iron or jazzy,meets the same problem;but humble is ok) when compiling libyaml_vendor:
then I check the CMakeLists.txt in libyaml_vendor, I use
cmake . -LAH
:I found ament_cmakeConfig.cmake in dir
/opt/ros/iron/share/ament_cmake/cmake/ament_cmakeConfig.cmake
,then I tried to add this to the CMakeLists,but it met other errors like this.