Install protobuf for kicad nightly build compilation?

when cloning the kicad repo and trying to build I get the following error saying it couldn’t find protobuf despite the bash commat protoc --version giving me the following output:

libprotoc 3.15.8

building with the following command:
sudo cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo ../../

output error:

CMake Error at CMakeLists.txt:883 (find_package):
  Could not find a package configuration file provided by "Protobuf" with any
  of the following names:

    ProtobufConfig.cmake
    protobuf-config.cmake

  Add the installation prefix of "Protobuf" to CMAKE_PREFIX_PATH or set
  "Protobuf_DIR" to a directory containing one of the above files.  If
  "Protobuf" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!

Any idea how to solve it?

Try adding -DKICAD_USE_CMAKE_FINDPROTOBUF=ON to your cmake configure

with: sudo cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DKICAD_USE_CMAKE_FINDPROTOBUF=ON ../../

I get the following error:

CMake Error at /usr/share/cmake-3.28/Modules/FindProtobuf.cmake:590 (file):
  file STRINGS file
  "/usr/include/google/protobuf/google/protobuf/stubs/common.h" cannot be
  read.
Call Stack (most recent call first):
  CMakeLists.txt:880 (include)


CMake Error at /usr/share/cmake-3.28/Modules/FindProtobuf.cmake:596 (math):
  math cannot parse the expression: " / 1000000": syntax error, unexpected
  exp_DIVIDE (2).
Call Stack (most recent call first):
  CMakeLists.txt:880 (include)


CMake Error at /usr/share/cmake-3.28/Modules/FindProtobuf.cmake:597 (math):
  math cannot parse the expression: " / 1000 % 1000": syntax error,
  unexpected exp_DIVIDE (2).
Call Stack (most recent call first):
  CMakeLists.txt:880 (include)


CMake Error at /usr/share/cmake-3.28/Modules/FindProtobuf.cmake:598 (math):
  math cannot parse the expression: " % 1000": syntax error, unexpected
  exp_MOD (2).
Call Stack (most recent call first):
  CMakeLists.txt:880 (include)


CMake Warning at /usr/share/cmake-3.28/Modules/FindProtobuf.cmake:623 (message):
  Protobuf compiler version 3.21.12 doesn't match library version
  ERROR.ERROR.ERROR
Call Stack (most recent call first):
  CMakeLists.txt:880 (include)


CMake Error at /usr/share/cmake-3.28/Modules/FindProtobuf.cmake:590 (file):
  file STRINGS file
  "/usr/include/google/protobuf/google/protobuf/stubs/common.h" cannot be
  read.
Call Stack (most recent call first):
  CMakeLists.txt:881 (find_package)


CMake Error at /usr/share/cmake-3.28/Modules/FindProtobuf.cmake:596 (math):
  math cannot parse the expression: " / 1000000": syntax error, unexpected
  exp_DIVIDE (2).
Call Stack (most recent call first):
  CMakeLists.txt:881 (find_package)


CMake Error at /usr/share/cmake-3.28/Modules/FindProtobuf.cmake:597 (math):
  math cannot parse the expression: " / 1000 % 1000": syntax error,
  unexpected exp_DIVIDE (2).
Call Stack (most recent call first):
  CMakeLists.txt:881 (find_package)


CMake Error at /usr/share/cmake-3.28/Modules/FindProtobuf.cmake:598 (math):
  math cannot parse the expression: " % 1000": syntax error, unexpected
  exp_MOD (2).
Call Stack (most recent call first):
  CMakeLists.txt:881 (find_package)


CMake Warning at /usr/share/cmake-3.28/Modules/FindProtobuf.cmake:623 (message):
  Protobuf compiler version 3.21.12 doesn't match library version
  ERROR.ERROR.ERROR
Call Stack (most recent call first):
  CMakeLists.txt:881 (find_package)

also reinstalled cmake by remove the cmake folders in ‘/usr/share/’ and reinstalling with apt

You appear to be missing the protobuf development files, which are usually in a different package from protoc. What platform are you on?

I’m on Ubuntu 24.04 and I installed protobuf with:
sudo apt-get install libprotobuf-dev protobuf-compiler

The thing is that protobuf lib changed structurally(also the protobuf source installment procedure) since last time I built kicad from source I was wondering if that also has something to do with this error.

is there another way / step to do after entering sudo apt-get install libprotobuf-dev protobuf-compiler
to install and setup protobuf? maybe add some environment variable?

Did you already try removing your CMakeCache.txt from the build folder?

Deleting “CMakeCache.txt” bypassed that error message and started building further but still getting this:

[1371/2231] Linking CXX executable gerbview/gerbview
FAILED: gerbview/gerbview
: && /usr/bin/c++ -Wno-attributes -pthread -Wall -Wsuggest-override -Wduplicated-branches -Wduplicated-cond -Werror=vla -Wimplicit-fallthrough=5 -Werror=return-type -Wshadow -Wsign-compare -Wmissing-field-initializers -Wempty-body -Wreorder -Wmismatched-tags -Wpessimizing-move -Wredundant-move -Wno-psabi -O2 -g -DNDEBUG  gerbview/CMakeFiles/gerbview.dir/__/common/single_top.cpp.o -o gerbview/gerbview  -Wl,-rpath,/usr/local/my_kicad_nightly/build/debug/common:/usr/local/my_kicad_nightly/build/debug/api:/usr/local/lib:  libs/core/libcore.a  common/libkicommon.so.9.0.0  -L/usr/lib/x86_64-linux-gnu  -pthread  -lwx_gtk3u_gl-3.2  -lwx_gtk3u_aui-3.2  -lwx_gtk3u_html-3.2  -lwx_gtk3u_core-3.2  -lwx_baseu_net-3.2  -lwx_baseu-3.2  -lwx_gtk3u_propgrid-3.2  -lwx_baseu_xml-3.2  -lwx_gtk3u_stc-3.2  -lwx_gtk3u_richtext-3.2  api/libkiapi.so.9.0.0  /usr/local/lib/libprotobuf.so  libs/kimath/libkimath.a  thirdparty/clipper2/libclipper2.a  -lm  libs/kiplatform/libkiplatform.a  libs/core/libcore.a  -L/usr/lib/x86_64-linux-gnu  -pthread  -lgtk-3  -lgdk-3  -lz  -lpangocairo-1.0  -lpango-1.0  -lharfbuzz  -latk-1.0  -lcairo-gobject  -lcairo  -lgdk_pixbuf-2.0  -lgio-2.0  -lgobject-2.0  -lglib-2.0  -lsecret-1  -lgio-2.0  -lgobject-2.0  -lglib-2.0  -lsecret-1  thirdparty/json_schema_validator/libnlohmann_json_schema_validator.a  thirdparty/fmt/libfmt.a  /usr/lib/x86_64-linux-gnu/libcurl.so  /usr/lib/x86_64-linux-gnu/libzstd.so  -lwx_gtk3u_gl-3.2  -lwx_gtk3u_aui-3.2  -lwx_gtk3u_html-3.2  -lwx_gtk3u_core-3.2  -lwx_baseu_net-3.2  -lwx_baseu-3.2  -lwx_gtk3u_propgrid-3.2  -lwx_baseu_xml-3.2  -lwx_gtk3u_stc-3.2  -lwx_gtk3u_richtext-3.2  /usr/lib/x86_64-linux-gnu/libgit2.so  /usr/lib/x86_64-linux-gnu/libfreetype.so  /usr/lib/x86_64-linux-gnu/libharfbuzz.so  /usr/lib/x86_64-linux-gnu/libfontconfig.so  /usr/lib/x86_64-linux-gnu/libpython3.12.so  libs/kinng/libkinng.a  /usr/lib/x86_64-linux-gnu/libnng.so && :
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::LogMessage::operator<<(char const*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::size() const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedField<int>::Reserve(int)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::io::EpsCopyOutputStream::WriteStringMaybeAliasedOutline(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::CopyWithSourceCheck(google::protobuf::Message&, google::protobuf::Message const&)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Add()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ParseContext::ReadSizeAndPushLimitAndDepth(char const*, int*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Get(int) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::WireFormatLite::VerifyUtf8String(char const*, int, google::protobuf::internal::WireFormatLite::Operation, char const*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::Clear()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::_InternalParse(char const*, google::protobuf::internal::ParseContext*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::FieldMask::FieldMask(google::protobuf::FieldMask const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::MapFieldBase::Destruct()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::ByteSizeLong() const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::FieldMask* google::protobuf::Arena::CreateMaybeMessage<google::protobuf::FieldMask>(google::protobuf::Arena*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `typeinfo for google::protobuf::internal::MapFieldBase'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::internal::RepeatedPtrFieldBase::AddOutOfLineHelper(void*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::GetTypeName[abi:cxx11]() const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Arena::AllocateAlignedWithHook(unsigned long, std::type_info const*)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::internal::AnyMetadata::UnpackTo(google::protobuf::Message*) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::LogMessage::~LogMessage()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Clear()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::MergeFrom(google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::io::EpsCopyOutputStream::WriteStringOutline(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Any* google::protobuf::Arena::CreateMaybeMessage<google::protobuf::Any>(google::protobuf::Arena*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Any::Any(google::protobuf::Any const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Arena::AllocateAlignedWithCleanup(unsigned long, std::type_info const*)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::internal::AnyMetadata::PackFrom(google::protobuf::Arena*, google::protobuf::Message const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `vtable for google::protobuf::MessageLite'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~RepeatedPtrField()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::SetCachedSize(int) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Arena::AllocateAlignedWithHookForArray(unsigned long, std::type_info const*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::FieldMask::MergeImpl(google::protobuf::Message&, google::protobuf::Message const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::stringpiece_internal::StringPiece::LogFatalSizeTooBig(unsigned long, char const*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::MergeImpl(google::protobuf::Message&, google::protobuf::Message const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::MapFieldBase::SetMapDirty()'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::Any::ParseAnyTypeUrl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::RepeatedPtrField(google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::RepeatedPtrField(google::protobuf::Arena*)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::MessageLite::ParseFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::fixed_address_empty_string[abi:cxx11]'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Any::MergeImpl(google::protobuf::Message&, google::protobuf::Message const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedField<int>::~RepeatedField()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::VerifyUTF8(google::protobuf::stringpiece_internal::StringPiece, char const*)'
collect2: error: ld returned 1 exit status
[1392/2231] Building CXX object pcbnew/CMa...ects.dir/dialogs/dialog_export_odbpp.cpp.o
ninja: build stopped: subcommand failed.
[3/853] Generating version string header
-- Found Git: /usr/bin/git (found version "2.43.0")
-- Using Git to determine build version string.
-- Not updating /usr/local/my_kicad_nightly/build/debug/kicad_build_version.h
[4/844] Linking CXX executable eeschema/eeschema
FAILED: eeschema/eeschema
: && /usr/bin/c++ -Wno-attributes -pthread -Wall -Wsuggest-override -Wduplicated-branches -Wduplicated-cond -Werror=vla -Wimplicit-fallthrough=5 -Werror=return-type -Wshadow -Wsign-compare -Wmissing-field-initializers -Wempty-body -Wreorder -Wmismatched-tags -Wpessimizing-move -Wredundant-move -Wno-psabi -O2 -g -DNDEBUG  eeschema/CMakeFiles/eeschema.dir/__/common/single_top.cpp.o -o eeschema/eeschema  -Wl,-rpath,/usr/local/my_kicad_nightly/build/debug/common:/usr/local/my_kicad_nightly/build/debug/api:/usr/local/lib:  common/libkicommon.so.9.0.0  -L/usr/lib/x86_64-linux-gnu  -pthread  -lwx_gtk3u_gl-3.2  -lwx_gtk3u_aui-3.2  -lwx_gtk3u_html-3.2  -lwx_gtk3u_core-3.2  -lwx_baseu_net-3.2  -lwx_baseu-3.2  -lwx_gtk3u_propgrid-3.2  -lwx_baseu_xml-3.2  -lwx_gtk3u_stc-3.2  -lwx_gtk3u_richtext-3.2  api/libkiapi.so.9.0.0  /usr/local/lib/libprotobuf.so  libs/kimath/libkimath.a  thirdparty/clipper2/libclipper2.a  -lm  libs/kiplatform/libkiplatform.a  libs/core/libcore.a  -L/usr/lib/x86_64-linux-gnu  -pthread  -lgtk-3  -lgdk-3  -lz  -lpangocairo-1.0  -lpango-1.0  -lharfbuzz  -latk-1.0  -lcairo-gobject  -lcairo  -lgdk_pixbuf-2.0  -lgio-2.0  -lgobject-2.0  -lglib-2.0  -lsecret-1  -lgio-2.0  -lgobject-2.0  -lglib-2.0  -lsecret-1  thirdparty/json_schema_validator/libnlohmann_json_schema_validator.a  thirdparty/fmt/libfmt.a  /usr/lib/x86_64-linux-gnu/libcurl.so  /usr/lib/x86_64-linux-gnu/libzstd.so  -lwx_gtk3u_gl-3.2  -lwx_gtk3u_aui-3.2  -lwx_gtk3u_html-3.2  -lwx_gtk3u_core-3.2  -lwx_baseu_net-3.2  -lwx_baseu-3.2  -lwx_gtk3u_propgrid-3.2  -lwx_baseu_xml-3.2  -lwx_gtk3u_stc-3.2  -lwx_gtk3u_richtext-3.2  /usr/lib/x86_64-linux-gnu/libgit2.so  /usr/lib/x86_64-linux-gnu/libfreetype.so  /usr/lib/x86_64-linux-gnu/libharfbuzz.so  /usr/lib/x86_64-linux-gnu/libfontconfig.so  /usr/lib/x86_64-linux-gnu/libpython3.12.so  libs/kinng/libkinng.a  /usr/lib/x86_64-linux-gnu/libnng.so && :
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::LogMessage::operator<<(char const*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::size() const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedField<int>::Reserve(int)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::io::EpsCopyOutputStream::WriteStringMaybeAliasedOutline(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::CopyWithSourceCheck(google::protobuf::Message&, google::protobuf::Message const&)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Add()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ParseContext::ReadSizeAndPushLimitAndDepth(char const*, int*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Get(int) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::WireFormatLite::VerifyUtf8String(char const*, int, google::protobuf::internal::WireFormatLite::Operation, char const*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::Clear()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::_InternalParse(char const*, google::protobuf::internal::ParseContext*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::FieldMask::FieldMask(google::protobuf::FieldMask const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::MapFieldBase::Destruct()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::ByteSizeLong() const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::FieldMask* google::protobuf::Arena::CreateMaybeMessage<google::protobuf::FieldMask>(google::protobuf::Arena*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `typeinfo for google::protobuf::internal::MapFieldBase'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::internal::RepeatedPtrFieldBase::AddOutOfLineHelper(void*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::GetTypeName[abi:cxx11]() const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Arena::AllocateAlignedWithHook(unsigned long, std::type_info const*)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::internal::AnyMetadata::UnpackTo(google::protobuf::Message*) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::LogMessage::~LogMessage()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Clear()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::MergeFrom(google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::io::EpsCopyOutputStream::WriteStringOutline(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Any* google::protobuf::Arena::CreateMaybeMessage<google::protobuf::Any>(google::protobuf::Arena*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Any::Any(google::protobuf::Any const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Arena::AllocateAlignedWithCleanup(unsigned long, std::type_info const*)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::internal::AnyMetadata::PackFrom(google::protobuf::Arena*, google::protobuf::Message const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `vtable for google::protobuf::MessageLite'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~RepeatedPtrField()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::SetCachedSize(int) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Arena::AllocateAlignedWithHookForArray(unsigned long, std::type_info const*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::FieldMask::MergeImpl(google::protobuf::Message&, google::protobuf::Message const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::stringpiece_internal::StringPiece::LogFatalSizeTooBig(unsigned long, char const*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::MergeImpl(google::protobuf::Message&, google::protobuf::Message const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::MapFieldBase::SetMapDirty()'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::Any::ParseAnyTypeUrl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::RepeatedPtrField(google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::RepeatedPtrField(google::protobuf::Arena*)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::MessageLite::ParseFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::fixed_address_empty_string[abi:cxx11]'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Any::MergeImpl(google::protobuf::Message&, google::protobuf::Message const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedField<int>::~RepeatedField()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::VerifyUTF8(google::protobuf::stringpiece_internal::StringPiece, char const*)'
collect2: error: ld returned 1 exit status
[5/844] Linking CXX executable gerbview/gerbview

Continueation:

FAILED: gerbview/gerbview
: && /usr/bin/c++ -Wno-attributes -pthread -Wall -Wsuggest-override -Wduplicated-branches -Wduplicated-cond -Werror=vla -Wimplicit-fallthrough=5 -Werror=return-type -Wshadow -Wsign-compare -Wmissing-field-initializers -Wempty-body -Wreorder -Wmismatched-tags -Wpessimizing-move -Wredundant-move -Wno-psabi -O2 -g -DNDEBUG  gerbview/CMakeFiles/gerbview.dir/__/common/single_top.cpp.o -o gerbview/gerbview  -Wl,-rpath,/usr/local/my_kicad_nightly/build/debug/common:/usr/local/my_kicad_nightly/build/debug/api:/usr/local/lib:  libs/core/libcore.a  common/libkicommon.so.9.0.0  -L/usr/lib/x86_64-linux-gnu  -pthread  -lwx_gtk3u_gl-3.2  -lwx_gtk3u_aui-3.2  -lwx_gtk3u_html-3.2  -lwx_gtk3u_core-3.2  -lwx_baseu_net-3.2  -lwx_baseu-3.2  -lwx_gtk3u_propgrid-3.2  -lwx_baseu_xml-3.2  -lwx_gtk3u_stc-3.2  -lwx_gtk3u_richtext-3.2  api/libkiapi.so.9.0.0  /usr/local/lib/libprotobuf.so  libs/kimath/libkimath.a  thirdparty/clipper2/libclipper2.a  -lm  libs/kiplatform/libkiplatform.a  libs/core/libcore.a  -L/usr/lib/x86_64-linux-gnu  -pthread  -lgtk-3  -lgdk-3  -lz  -lpangocairo-1.0  -lpango-1.0  -lharfbuzz  -latk-1.0  -lcairo-gobject  -lcairo  -lgdk_pixbuf-2.0  -lgio-2.0  -lgobject-2.0  -lglib-2.0  -lsecret-1  -lgio-2.0  -lgobject-2.0  -lglib-2.0  -lsecret-1  thirdparty/json_schema_validator/libnlohmann_json_schema_validator.a  thirdparty/fmt/libfmt.a  /usr/lib/x86_64-linux-gnu/libcurl.so  /usr/lib/x86_64-linux-gnu/libzstd.so  -lwx_gtk3u_gl-3.2  -lwx_gtk3u_aui-3.2  -lwx_gtk3u_html-3.2  -lwx_gtk3u_core-3.2  -lwx_baseu_net-3.2  -lwx_baseu-3.2  -lwx_gtk3u_propgrid-3.2  -lwx_baseu_xml-3.2  -lwx_gtk3u_stc-3.2  -lwx_gtk3u_richtext-3.2  /usr/lib/x86_64-linux-gnu/libgit2.so  /usr/lib/x86_64-linux-gnu/libfreetype.so  /usr/lib/x86_64-linux-gnu/libharfbuzz.so  /usr/lib/x86_64-linux-gnu/libfontconfig.so  /usr/lib/x86_64-linux-gnu/libpython3.12.so  libs/kinng/libkinng.a  /usr/lib/x86_64-linux-gnu/libnng.so && :
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::MaybeComputeUnknownFieldsSize(unsigned long, google::protobuf::internal::CachedSize*) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::LogMessage::operator<<(char const*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::size() const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedField<int>::Reserve(int)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::io::EpsCopyOutputStream::WriteStringMaybeAliasedOutline(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::CopyWithSourceCheck(google::protobuf::Message&, google::protobuf::Message const&)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Add()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ParseContext::ReadSizeAndPushLimitAndDepth(char const*, int*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Get(int) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::WireFormatLite::VerifyUtf8String(char const*, int, google::protobuf::internal::WireFormatLite::Operation, char const*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::Clear()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::_InternalParse(char const*, google::protobuf::internal::ParseContext*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::FieldMask::FieldMask(google::protobuf::FieldMask const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::MapFieldBase::Destruct()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::ByteSizeLong() const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::FieldMask* google::protobuf::Arena::CreateMaybeMessage<google::protobuf::FieldMask>(google::protobuf::Arena*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `typeinfo for google::protobuf::internal::MapFieldBase'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::internal::RepeatedPtrFieldBase::AddOutOfLineHelper(void*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::GetTypeName[abi:cxx11]() const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Arena::AllocateAlignedWithHook(unsigned long, std::type_info const*)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::internal::AnyMetadata::UnpackTo(google::protobuf::Message*) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::LogMessage::~LogMessage()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::Clear()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::MergeFrom(google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::io::EpsCopyOutputStream::WriteStringOutline(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Any* google::protobuf::Arena::CreateMaybeMessage<google::protobuf::Any>(google::protobuf::Arena*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Any::Any(google::protobuf::Any const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Arena::AllocateAlignedWithCleanup(unsigned long, std::type_info const*)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::internal::AnyMetadata::PackFrom(google::protobuf::Arena*, google::protobuf::Message const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const* (*)(), std::once_flag*, google::protobuf::Metadata const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `vtable for google::protobuf::MessageLite'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~RepeatedPtrField()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Message::SetCachedSize(int) const'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Arena::AllocateAlignedWithHookForArray(unsigned long, std::type_info const*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::FieldMask::MergeImpl(google::protobuf::Message&, google::protobuf::Message const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::stringpiece_internal::StringPiece::LogFatalSizeTooBig(unsigned long, char const*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::ZeroFieldsBase::MergeImpl(google::protobuf::Message&, google::protobuf::Message const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::MapFieldBase::SetMapDirty()'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::Any::ParseAnyTypeUrl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::internal::ArenaStringPtr::Set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Arena*)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::RepeatedPtrField(google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::RepeatedPtrField(google::protobuf::Arena*)'
/usr/bin/ld: common/libkicommon.so.9.0.0: undefined reference to `google::protobuf::MessageLite::ParseFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::fixed_address_empty_string[abi:cxx11]'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::Any::MergeImpl(google::protobuf::Message&, google::protobuf::Message const&)'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::RepeatedField<int>::~RepeatedField()'
/usr/bin/ld: api/libkiapi.so.9.0.0: undefined reference to `google::protobuf::internal::VerifyUTF8(google::protobuf::stringpiece_internal::StringPiece, char const*)'
collect2: error: ld returned 1 exit status
[25/844] Building CXX object pcbnew/CMakeF...ialogs/dialog_gen_footprint_position.cpp.o
ninja: build stopped: subcommand failed.

Looks like something is wrong with either your Protobuf installation or how CMake found it. I am not near an Ubuntu machine so I can’t check anything right now, all I can say is “works for me” last I tried it.

Yeah I guess the way I install it is with:
sudo apt install libprotobuf-dev protobuf-compiler

Is there another way to install it for building kicad?

Those are the packages installed for the PPA builder, there shouldn’t be anything else needed.

Your linker command has /usr/local/lib/libprotobuf.so being passed in; Ubuntu packages should not be in /usr/local. It looks like maybe you have a manual installation of protobuf that is broken or incomplete? You will need to either remove this or tell CMake to look at the system protobuf instead of this one.

Ubuntu packages should not be in /usr/local . It looks like maybe you have a manual installation of protobuf that is broken or incomplete?

I Might, I just don’t know how to completely delete it in ubuntu beyond sudo apt remove protobuf-compile

CMake to look at the system protobuf instead of this one.

I’m not that much of a pro with cmake not sure how to do that.

That would not do anything but remove the system installation. You also have a user installation that you must have gotten some other way. How you got it is key to how to remove it. I can’t tell you for sure how to do it (other than going into your /usr/local/ folder and removing protobuf-related stuff manually)

You’ll have to override some of the vars set by FindProtobuf. I can’t tell you which exactly because I’m not in a position to test, but if you look in your CMakeCache for anything starting with Protobuf_ that points to /usr/local, you probably want to force that to be pointing to /usr instead.

I now followed protobuf build from source here:

and installed it @‘~/Downloads/protobuf’
and moved the execution binary to ‘/usr/local/bin/’ with cp bazel-bin/protoc /usr/local/bin like the README suggests and it still gives me the error, maybe i need to add ‘~/Downloads/protobuf’ to search path in the source folder CMakeLists.txt somehow?

If you are trying to install your own copy of protobuf, you are on your own, I’m sorry. The only validated way to build on Ubuntu is by using the Ubuntu packages.

ofcourse I preffer the out of the box apt version of protobuf since I don’t even regularlly use this tool but this ain’t working so I’m also trying the source build option of protobuf out of hopelessness…
I mean what does kicad cmake looks for other than the protoc binary @‘/usr/loca/bin/’?

I told you this already…

-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.a (found version "3.21.12")
CMake Error at CMakeLists.txt:887 (find_package):
  Could not find a package configuration file provided by "Protobuf" with any
  of the following names:

    ProtobufConfig.cmake
    protobuf-config.cmake

  Add the installation prefix of "Protobuf" to CMAKE_PREFIX_PATH or set
  "Protobuf_DIR" to a directory containing one of the above files.  If
  "Protobuf" provides a separate development package or SDK, be sure it has
  been installed.

it points to “/usr/lib/x86_64-linux-gnu/libprotobuf.a” from there I’m lost…

and this it the complete log after:
sudo cmake -G Ninja -DKICAD_USE_CMAKE_FINDPROTOBUF=ON ../../

sudo ninja
[21/2229] Configuring Linux metainfo
-- Creating linux metadata
-- Found Git: /usr/bin/git (found version "2.43.0")
-- Using Git to determine build version string.
[48/2229] Building C object thirdparty/3dx...akeFiles/TDxNavlib.dir/src/navlib_stub.c.o
In file included from /usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/inc/navlib/navlib.h:27,
                 from /usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/src/navlib_stub.c:51:
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/inc/navlib/navlib_types.h:1232:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
 1232 | typedef long(__cdecl *fnGetProperty_t)(const param_t param, const property_t name, value_t *value);
      | ^~~~~~~
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/inc/navlib/navlib_types.h:1246:40: warning: ‘cdecl’ attribute ignored [-Wattributes]
 1246 |                                        const value_t *value);
      |                                        ^~~~~
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/inc/navlib/navlib.h:594:38: warning: ‘cdecl’ attribute ignored [-Wattributes]
  594 |                                      const nlCreateOptions_t *options);
      |                                      ^~~~~
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/inc/navlib/navlib.h:602:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  602 | _NAVLIB_DLLAPI long __cdecl NlClose(nlHandle_t nh);
      | ^~~~~~~~~~~~~~
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/inc/navlib/navlib.h:613:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  613 | _NAVLIB_DLLAPI long __cdecl NlReadValue(nlHandle_t nh, property_t name, value_t *value);
      | ^~~~~~~~~~~~~~
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/inc/navlib/navlib.h:624:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  624 | _NAVLIB_DLLAPI long __cdecl NlWriteValue(nlHandle_t nh, property_t name, const value_t *value);
      | ^~~~~~~~~~~~~~
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/inc/navlib/navlib.h:631:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  631 | _NAVLIB_DLLAPI propertyType_t __cdecl NlGetType(property_t name);
      | ^~~~~~~~~~~~~~
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/src/navlib_stub.c:69:40: warning: ‘cdecl’ attribute ignored [-Wattributes]
   69 |                                        nlCreateOptions_t const* options );
      |                                        ^~~~~~~~~~~~~~~~~
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/src/navlib_stub.c:70:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
   70 | typedef long( __cdecl* PFN_NLCLOSE )( nlHandle_t nh );
      | ^~~~~~~
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/src/navlib_stub.c:71:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
   71 | typedef long( __cdecl* PFN_NLREADVALUE )( nlHandle_t nh, property_t name, value_t* value );
      | ^~~~~~~
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/src/navlib_stub.c:72:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
   72 | typedef long( __cdecl* PFN_NLWRITEVALUE )( nlHandle_t nh, property_t name, const value_t* value );
      | ^~~~~~~
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/src/navlib_stub.c:73:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
   73 | typedef propertyType_t( __cdecl* PFN_NLGETTYPE )( property_t name );
      | ^~~~~~~
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/src/navlib_stub.c:159:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  159 | {
      | ^
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/src/navlib_stub.c:169:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  169 | {
      | ^
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/src/navlib_stub.c:179:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  179 | {
      | ^
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/src/navlib_stub.c:189:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  189 | {
      | ^
/usr/local/my_kicad_nightly/thirdparty/3dxware_sdk/src/navlib_stub.c:199:1: warning: ‘cdecl’ attribute ignored [-Wattributes]
  199 | {
      | ^
[113/2229] Generating version string header
-- Found Git: /usr/bin/git (found version "2.43.0")
-- Using Git to determine build version string.
-- Writing /usr/local/my_kicad_nightly/build/debug/kicad_build_version.h file with version: 9.0.0-rc3-32-g564710b232-dirty
[121/2229] Linking CXX shared library api/libkiapi.so.9.0.0
FAILED: api/libkiapi.so.9.0.0
: && /usr/bin/c++ -fPIC -Wno-attributes -pthread -O3 -DNDEBUG   -shared -Wl,-soname,libkiapi.so.9.0.0 -o api/libkiapi.so.9.0.0 api/CMakeFiles/kiapi.dir/cpp/api/common/envelope.pb.cc.o api/CMakeFiles/kiapi.dir/cpp/api/common/types/base_types.pb.cc.o api/CMakeFiles/kiapi.dir/cpp/api/common/types/enums.pb.cc.o api/CMakeFiles/kiapi.dir/cpp/api/common/types/project_settings.pb.cc.o api/CMakeFiles/kiapi.dir/cpp/api/common/commands/base_commands.pb.cc.o api/CMakeFiles/kiapi.dir/cpp/api/common/commands/editor_commands.pb.cc.o api/CMakeFiles/kiapi.dir/cpp/api/common/commands/project_commands.pb.cc.o api/CMakeFiles/kiapi.dir/cpp/api/board/board.pb.cc.o api/CMakeFiles/kiapi.dir/cpp/api/board/board_commands.pb.cc.o api/CMakeFiles/kiapi.dir/cpp/api/board/board_types.pb.cc.o api/CMakeFiles/kiapi.dir/cpp/api/schematic/schematic_types.pb.cc.o api/CMakeFiles/kiapi.dir/cpp/api/schematic/schematic_commands.pb.cc.o  /usr/lib/x86_64-linux-gnu/libprotobuf.a && :
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libprotobuf.a(arena.o): relocation R_X86_64_TPOFF32 against symbol `_ZN6google8protobuf8internal15ThreadSafeArena13thread_cache_E' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
[142/2229] Building CXX object libs/kimath...math.dir/src/geometry/shape_poly_set.cpp.o
ninja: build stopped: subcommand failed.

for today I’m out

This is what is in my CMakeCache.txt:

//Path to a file.
Protobuf_INCLUDE_DIR:PATH=/usr/include

//Path to a library.
Protobuf_LIBRARY_DEBUG:FILEPATH=/usr/lib/x86_64-linux-gnu/libprotobuf.so

//Path to a library.
Protobuf_LIBRARY_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libprotobuf.so

//Path to a library.
Protobuf_LITE_LIBRARY_DEBUG:FILEPATH=/usr/lib/x86_64-linux-gnu/libprotobuf-lite.so

//Path to a library.
Protobuf_LITE_LIBRARY_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libprotobuf-lite.so

//The Google Protocol Buffers Compiler
Protobuf_PROTOC_EXECUTABLE:FILEPATH=/usr/bin/protoc

Note the so files not the a.