Ubuntu显示“submodule(s) are missing“或“子模块未对路径注册“解决方案

  • Post author:
  • Post category:其他

最近测试openMVG的三维重建效果,于是在github下克隆openMVG的库,git clone过程成功进行,但是在build文件夹下cmake的时候error occured!
错误显示”submodule(s) are missing”

1、更新模块

主文件夹下执行以下命令

git clone 父项目.git
git submodule init
git submodule update (update时,submodule分支必须已在正确分支上)

参考链接:git submodule 使用命令简介

但我仍然出现了”子模块未对路径注册”的错误,猜测是github最近登不上去,所以子模块clone不下来,于是对相应的子模块进行手动git clone

2、找到缺失子模块的github地址,导入gitee

例如:终端显示

"https://github.com/openMVGthirdparty/cereal.git"未对路径注册

则进入gitee新建仓库,从github导入地址为”https://github.com/openMVGthirdparty/cereal.git”的库
在这里插入图片描述导入后gitee上该库的地址为”https://gitee.com/lianqi1008/openMVG-thirdparty-cereal.git”

3、进入缺失子模块文件夹内克隆该仓库

在/home/openMVG/src/dependencies路径下发现三个缺失的子模块依赖对应的空文件夹

在这里插入图片描述
以cereal为例:

cd /home/openMVG/src/dependencies/cereal
git clone https://gitee.com/lianqi1008/openMVG-thirdparty-cereal.git

依次克隆其余两个依赖,完成后重新对openMVG执行cmake,顺利进行。


版权声明:本文为vanilla_an原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。