2017-06-30 65 views
0

我使用Ubuntu 16.04,gcc 5.4.0和CLion(C++環境)。 我正在嘗試使用caffe。它需要protobuf進行安裝。 所以,它在Python工作正常,但C++給了我一個運行時異常:在Ubuntu上使用caffe(C++)時Protobuf版本衝突

libprotobuf FATAL google/protobuf/stubs/common.cc:78] This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.3.0). Contact the program author for an update. If you compiled the program yourself, makesure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "/build/mir-ui6vjS/mir-0.26.3+16.04.20170605/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".) 
    terminate called after throwing an instance of 'google::protobuf::FatalException' 
    what(): This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.3.0). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "/build/mir-ui6vjS/mir-0.26.3+16.04.20170605/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".) 

據我瞭解,除了告訴我,它需要protobuf的2.6.1,但安裝3.3.0。 但命令apt-get upgrade libprotobuf-dev給我libprotobuf-dev is already the newest version (2.6.1-1.3)。所以我確實有2.6.1。

請問您,請指教我如何解決它?

P.S.我不知道這是否是重要的或沒有,但我加朱古力路徑在〜/ .bashrc

+0

你正在使用多少版本的protobuf?我猜你可能已經安裝了它們,你需要卸載libprotobuf-dev並再次構建caffe .. – Eliethesaiyan

+0

這是我做的。 1)sudo易於得到刪除libprotobuf-dev的protobuf的編譯 2)sudo易於得到升級libprotobuf-dev的 (以確保它被刪除,它是) 3)朱古力文件夾:**使乾淨**和**使所有** 最後CLion給出了相同的reesult。 –

+1

你怎麼得到這個協議 - 版本 – Eliethesaiyan

回答

0

您可以指定要在

CAFFE_ROOT使用的版本/ cmake的/ Protobuf.cmake

在find_package添加的版本號:

find_package(Protobuf 2.6.1 REQUIRED) 

這樣,你可以保持多個版本也沒關係。

ps:我不確定版本3.3.0是否支持無論如何看this