Redhat 시스템에 Protobuf 설치
6151 단어 Linux
저는 여기서 프로토퍼-3.2.0을 내렸어요.tar.gz.
# tar zxvf protobuf-3.2.0.tar.tgz
# cd protobuf-3.2.0/
# ./configure
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-unknown-linux-gnu
......................
configure: creating ./config.status
config.status: creating Makefile
config.status: creating scripts/gtest-config
config.status: creating build-aux/config.h
config.status: executing depfiles commands
config.status: executing libtool commands
# make
make all-recursive
......................
make[2]: ***[google/protobuf/any.pb.lo] Error 1
make[2]: Leaving directory '/root/K80/protobuf-3.2.0/src'
make[1]: ***[all-recursive] Error 1
make[1]: Leaving directory '/root/K80/protobuf-3.2.0'
make: *** [all] Error 2
인터넷에 접속해서 찾아봤는데 어떤 사람이 오토벤을 사용한다고 했어요.sh 먼저 뛰기:
# ./autogen.sh
./autogen.sh: line 48: autoreconf: command not found
autoreconf가 설치되어 있지 않은 것을 발견했습니다. autoreconf, automake,libtool 세 개의 패키지를 설치합니다.
Step 1 autoreconf 설치
# tar zxvf autoconf-2.69.tar.gz
# cd autoconf-2.69/
# ./configure
# make
# make install
autoconf가 성공적으로 설치되었는지 확인하려면:
# autoconf --version
autoconf (GNU Autoconf) 2.69
...
...
...
Step 2 automake 설치, 여기서 다운로드
# tar zxvf automake-1.14.tar.gz
# cd automake-1.14/
# ./configure
# make
# make install
automake 경로와 버전을 보려면 다음과 같이 하십시오.
# which auautomake
/usr/local/bin/automake
# automake --version
automake (GNU automake) 1.14
Step 3 libtool 설치, 여기서 다운로드
# tar -xzf libtool-2.4.2.tar.gz
# cd libtool-2.4.2
# ./configure
# make
# make install
# make check
autogen을 다시 실행합니다.sh:
# ./autogen.sh
# ./configure --prefix=/usr/local/protobuf
# make
'google::protobuf::internal::InternalMetadataWithArena::InternalMetadataWithArena(google::protobuf::Arena*)':
./google/protobuf/metadata.h:175: error: class 'google::protobuf::internal::InternalMetadataWithArena' does not have any field named 'InternalMetadataWithArenaBase'
./google/protobuf/metadata.h: In constructor 'google::protobuf::internal::InternalMetadataWithArenaLite::InternalMetadataWithArenaLite(google::protobuf::Arena*)':
./google/protobuf/metadata.h:204: error: class 'google::protobuf::internal::InternalMetadataWithArenaLite' does not have any field named 'InternalMetadataWithArenaBase'
make[2]: *** [google/protobuf/any.pb.lo] Error 1
make[2]: Leaving directory /home/protobuf/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/protobuf'
make: *** [all] Error 2
위의 오류는 구글의 버그입니다. #2559에서 수정되었지만,release에서 변경되지 않았을 수도 있습니다. 수동으로 변경하십시오.
# cd /src/google/protobuf/
# vim metadata.h
메타데이터에.h에서 다음과 같이 변경합니다.
public:
InternalMetadataWithArena() {}
explicit InternalMetadataWithArena(Arena* arena)
- : InternalMetadataWithArenaBase(arena) {}
+ : InternalMetadataWithArenaBase(arena) {}
void DoSwap(UnknownFieldSet* other) {
mutable_unknown_fields()->Swap(other);
@@ -201,7 +202,8 @@ class InternalMetadataWithArenaLite
InternalMetadataWithArenaLite() {}
explicit InternalMetadataWithArenaLite(Arena* arena)
- : InternalMetadataWithArenaBase(arena) {}
+ : InternalMetadataWithArenaBase(arena) {}
void DoSwap(string* other) {
mutable_unknown_fields()->swap(*other);
다시 make:
# make
# make install
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
바이너리 파일cat 또는tail, 터미널 디코딩 시 처리 방법cat으로 바이너리 파일을 보려고 할 때 코드가 엉망이 되어 식은땀이 났다. 웹에서 스크롤된 정보의 처리 방법과alias의 설정을 요약합니다. reset 명령을 사용하여 터미널을 재설정합니다.이렇게 하면 고치지 못하...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.