Command ‘[‘make‘, ‘-j12‘, ‘-l12‘]‘ returned non-zero exit

Failed to process package 'cartographer': Command '['make', '-j12', '-l12']' returned non-zero exit status 2. Reproduce this error by running: ==> cd 

This error was encountered during the installation of cartographer. The reason is that the protoc version is wrong. The solution is to uninstall the protoc that comes with ros and reinstall it.

$ VERSION="v3.4.1"
$ git clone protocolbuffers/protobuf
$ cd protobuf
$ git checkout tags/${
    
    VERSION}
$ mkdir build
$ cd build
$ cmake -G Ninja \
    -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
    -DCMAKE_BUILD_TYPE=Release \
    -Dprotobuf_BUILD_TESTS=OFF \
    ../cmake
$ ninja
$ sudo ninja install

Guess you like

Origin blog.csdn.net/m0_63715549/article/details/131937001