2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

WSL2上のUbuntuでcatkin_make

Last updated at Posted at 2021-12-21

catkin_makeでwindowsのファイルシステムが原因のエラー

WSL2上のUbuntuにROSをインストールしcatkin_makeを実行すると

-- BUILD_SHARED_LIBS is on
/home/xxxxxx/catkin_ws/devel/env.sh: 4: export: Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2020.824.0_x64__79rhkp1fndgsc:/mnt/c/Program: bad variable name
Traceback (most recent call last):
  File "/home/xxxxxx/catkin_ws/build/catkin_generated/generate_cached_setup.py", line 22, in <module>
    code = generate_environment_script('/home/xxxxxx/catkin_ws/devel/env.sh')

のようなエラーが起こる場合がある。

原因

windowsのディレクトリ名にスペース(Program[space]Files)を含むものがあり、UNIXのスクリプトがワードの区切りと誤認識することが原因

対策

windowsのPATHを継承しないようにする。→WSL2でWindowsのPATH設定が引き継がれるのを解除する
あるいは、windowsのPATHを除いてPATH環境変数を再設定してもよい
こちらの記事も類似の事象です→WSL2にROS導入メモ

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?