LoginSignup
1
1

More than 5 years have passed since last update.

mosh 導入前の google/protobuf のインストールに失敗する

Last updated at Posted at 2016-04-17

Google Cloud Platform が60日間($300まで)無料開放されたことをつい最近知り、お試しで遊んでおります。

私はファミリーレストラン「ガスト」で作業することが多いのですが、Compute Engine に gcloudコマンドで接続するとwifi環境ではブツブツ切断されるので mosh を利用しています。

発生したこと

2016/4/9 に立てたインスタンスでは、すんなり protobuf と mosh が導入できましたが、2016/4/17 に新規インスタンスで mosh を導入してみると protobuf のインストールでエラーが発生しました。

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -g -DNDEBUG -MT google/protobuf/map_field.lo -MD -MP -MF google/protobuf/.deps/map_field.Tpo -c google/protobuf/map_field.cc  -fPIC -DPIC -o google/protobuf/.libs/map_field.o
In file included from ./google/protobuf/map_field_lite.h:34,
                 from ./google/protobuf/map_field.h:40,
                 from google/protobuf/map_field.cc:31:
./google/protobuf/map.h: In constructor ‘google::protobuf::Map<Key, T>::MapAllocator<U>::MapAllocator(const google::protobuf::Map<Key, T>::MapAllocator<X>&) [with X = google::protobuf::Map<google::protobuf::MapKey, google::protobuf::MapValueRef>::KeyValuePair, U = google::protobuf::Map<google::protobuf::MapKey, google::protobuf::MapValueRef>::InnerMap::Node, Key = google::protobuf::MapKey, T = google::protobuf::MapValueRef]’:
./google/protobuf/map.h:1278:   instantiated from ‘U* google::protobuf::Map<Key, T>::InnerMap::Alloc(size_t) [with U = google::protobuf::Map<google::protobuf::MapKey, google::protobuf::MapValueRef>::InnerMap::Node, Key = google::protobuf::MapKey, T = google::protobuf::MapValueRef]’
./google/protobuf/map.h:957:   instantiated from ‘std::pair<google::protobuf::Map<Key, T>::InnerMap::iterator_base<google::protobuf::Map<Key, T>::KeyValuePair>, bool> google::protobuf::Map<Key, T>::InnerMap::insert(const google::protobuf::Map<Key, T>::KeyValuePair&) [with Key = google::protobuf::MapKey, T = google::protobuf::MapValueRef]’
./google/protobuf/map.h:986:   instantiated from ‘google::protobuf::MapPair<Key, T>*& google::protobuf::Map<Key, T>::InnerMap::operator[](const Key&) [with Key = google::protobuf::MapKey, T = google::protobuf::MapValueRef]’
./google/protobuf/map.h:1492:   instantiated from ‘T& google::protobuf::Map<Key, T>::operator[](const Key&) [with Key = google::protobuf::MapKey, T = google::protobuf::MapValueRef]’
google/protobuf/map_field.cc:185:   instantiated from here
./google/protobuf/map.h:656: error: ‘google::protobuf::Arena* const google::protobuf::Map<google::protobuf::MapKey, google::protobuf::MapValueRef>::MapAllocator<google::protobuf::Map<google::protobuf::MapKey, google::protobuf::MapValueRef>::KeyValuePair>::arena_’ is private
./google/protobuf/map.h:592: error: within this context
make[2]: *** [google/protobuf/map_field.lo] エラー 1
make[2]: ディレクトリ `/home/hogehoge/Downloads/protobuf-master/src' から出ます
make[1]: *** [all-recursive] エラー 1
make[1]: ディレクトリ `/home/hogehoge/Downloads/protobuf-master' から出ます
make: *** [all] エラー 2

回避方法

いつもは最新のソースをここからzipファイルを落としてきてましたが、最近も盛んにcommitされているようですね。

エラー解析が面倒だったので 古いリビジョンに落としてみました。

2016/4/9 はOKだったので、Commits on Apr 8, 2016 のリビジョンに戻しコンパイルしてみました。

git clone https://github.com/google/protobuf.git
cd protobuf/
git revert 0a902ee0acabf15f7d5f21b4d6ea0574495488f6
./autogen.sh 
./configure --with-PACKAGE
make
sudo make install

結果は、、、無事にコンパイルできました。
当面の間はバージョンアップ状態見ながら、これで逃げておこうと思います

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1