Ubuntu 16.04: Version conflict of Protocol buffer library for version 2.6.1 and 3.6.1 while building application with or-tools

1,505 views
Skip to first unread message

Nitin Katiyar

unread,
Apr 21, 2019, 10:16:30 AM4/21/19
to or-tools-discuss
I have used following steps while integrating or-tools in the application:

1. Download and install instructions from https://developers.google.com/optimization/install/cpp/source_linux
2. Prerequisite: C++ tools:
    sudo apt-get -y install git wget pkg-config build-essential cmake autoconf libtool zlib1g-dev lsb-release
3. Download source zip file
    wget "https://github.com/google/or-tools/archive/v7.0.zip"
4. Extract zip file, or-tools-7.0 directory will have sources
5. Build or-tools
    cd  or-tools-7.0
    make third_party
    make cc

6. Linux info:
Linux MYE1LD0001 4.8.0-36-generic #36~16.04.1-Ubuntu SMP Sun Feb 5 09:39:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Error log:


[libprotobuf FATAL /home/k_nitin/src/or-tools-7.0/dependencies/sources/protobuf-3.6.1/src/google/protobuf/stubs/common.cc:79] This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.6.1).  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-O8_xaj/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.6.1).  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-O8_xaj/mir-0.26.3+16.04.20170605/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".)


Please suggest.

core...@google.com

unread,
Apr 23, 2019, 2:44:53 AM4/23/19
to or-tools...@googlegroups.com
I would say you must have a protoc 2.6.1 in your path which take precedence over the one build by or-tools.

try to locate it by using `which protoc`.

did you get this error during the `make third_party` or `make cc` ?

Nitin Katiyar

unread,
Apr 23, 2019, 7:33:42 AM4/23/19
to or-tools-discuss
I do not get any error during the "make third_party" or "make cc".
I have ensured no protobuf 2.6.1 headers are used during above commands and both commands work well, no errors are encountered during installation of or-tools.

As per my analysis, I am using Qt framework and Qt libraries are using gtk libraries. These gtk libraries use mirprotobuf library that is compiled using 2.6.1 version.

Ubuntu 16.04 has protobuf 2.6.1 library by default and gtk and other system libraries depend on it as they are compiled using 2.6.1 version. When I removed 2.6.1 protolib libraries Ubuntu Desktop did not start after reboot.

Since I can't compile gtk and Qt libraries with 3.6.1, I am retrying with Ubuntu 18.04. I hope I will not encounter this issue as I have read somewhere Ubuntu 18.04 has protobuf 3.6.1 as default library.

Corentin Le Molgat

unread,
Apr 23, 2019, 8:02:53 AM4/23/19
to or-tools...@googlegroups.com
According to distro repo information you should get protobuf 3.0, it seems Protobuf 3.6.1 will be integrated in Ubuntu 19.04


The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future.


--
You received this message because you are subscribed to a topic in the Google Groups "or-tools-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/or-tools-discuss/wyBNIcVpek0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/30604423-674b-4e69-acbf-76ed329ccb80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages