Arducopter build errors despite origin is in sync with upstream

Sorry to bug folks I’m having some trouble figuring this out. I’m almost about to just delete and remake my fork but thought I’d ask for some advice.

My github.com fork has Copter-4.1 branch in sync with the upstream Copter-4.1

I delete and re-cloned my local repository to this fork (and updated submodules).

When I “checkout Copter-4.1” and build (I do ./waf clean; ./waf configure --board MatekF405-Wing;; ./waf copter) , I get errors like this:

if I “checkout master” and build, everything is fine.

I noticed that whenever check out my origin/Copter-4.1, I have some code in staging area, which is odd. I don’t know how they got there or out to make “git status” clean.

I tried one more thing which was checkout Copter-4.0 which I know for certain I didn’t push any changes to my origin on, and I also changes in staging area and get build errors.

FWIW I have a 4.1 branch - andyp1per/small-copter-4.1 that includes the expo changes

Thank you, I’ll try cloning and building that =D

Your mavlink submodule isn’t in sync with the ArduPilot code, hence the build error in GCS_Mavlink.

You can reset the submodules to the correct state via:

git submodule foreach --recursive git clean -xfd
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive

Thank you! This solved it for me.