Build fails: ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)

オープン
#1,871 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp
領域
build-system

調査の方向性

Reproduce the 0.10.9 build on FreeBSD 13.2 with clang-15, then inspect the linker flags used for ola/.libs/libola.so and plugins/usbdmx. Verify whether the protobuf library is included without manually adding -lprotobuf to LDFLAGS; done means the link succeeds and the undefined protobuf symbols are resolved.

索引モデルが issue の本文から書いたものです。

説明

bug Language-C++ Maintainability OpSys-*BSD
libtool: link: ( cd "plugins/usbdmx/.libs" && rm -f "libolausbdmxwidget.la" && ln -s "../libolausbdmxwidget.la" "libolausbdmxwidget.la" )
ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)
>>> referenced by ola/.libs/libola.so

ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::LogMessage::operator<<(char const*)
>>> referenced by ola/.libs/libola.so

ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)
>>> referenced by ola/.libs/libola.so

ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::LogMessage::~LogMessage()
>>> referenced by ola/.libs/libola.so

ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::ZeroFieldsBase::~ZeroFieldsBase()
>>> referenced by ola/.libs/libola.so

ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::ArenaStringPtr::Set(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, google::protobuf::Arena*)
>>> referenced by ola/.libs/libola.so

ld: error: undefined reference due to --no-allow-shlib-undefined: google::protobuf::internal::ArenaStringPtr::Set(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&&, google::protobuf::Arena*)
>>> referenced by ola/.libs/libola.so
c++: error: linker command failed with exit code 1 (use -v to see invocation)

Adding -lprotobuf to LDFLAGS corrects this problem.

Version: 0.10.9
clang-15
FreeBSD 13.2

主要言語
C++
スター
773
フォーク
233
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OpenLightingProject/ola のほかの issue

OpenLightingProject/ola の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。