LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Protobuf compiler version 3.0.0 doesn't match library version 2.6.1 - Aspera Transfer SDK (https://www.linuxquestions.org/questions/linux-newbie-8/protobuf-compiler-version-3-0-0-doesnt-match-library-version-2-6-1-aspera-transfer-sdk-4175684062/)

Aquarius_Girl 10-22-2020 08:19 AM

Protobuf compiler version 3.0.0 doesn't match library version 2.6.1 - Aspera Transfer SDK
 
Have downloaded Transfer SDK from here:

https://api.ibm.com/explorer/catalog...k/doc/overview

Have installed protobuf-2.6.1 from source. Default protobuf that comes with Ubuntu is of higher version.

Code:

    ~$ protoc --version
    libprotoc 2.6.1

cmake .. result:

Code:

    /aspera/transfer-sdk/linux-amd64/connectors/cpp/build$ cmake ..
    -- The C compiler identification is GNU 7.5.0
    -- The CXX compiler identification is GNU 7.5.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found Protobuf: /usr/local/lib/libprotobuf.so;-lpthread (found version "2.6.1")
    -- Configuring done
    -- Generating done
    -- Build files have been written to: .....work/aspera/transfer-sdk/linux-amd64/connectors/cpp/build

It is detecting protobuf 2.6.1 but make doesn't want this version of protobuf.


Code:

    $ make
    Scanning dependencies of target asperatransfer
    [ 14%] Building CXX object CMakeFiles/asperatransfer.dir/transfer.pb.cc.o
    In file included from .../work/aspera/transfer-sdk/linux-amd64/connectors/cpp/transfer.pb.cc:4:0:
    .../work/aspera/transfer-sdk/linux-amd64/connectors/cpp/transfer.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
    #error This file was generated by an older version of protoc which is
      ^~~~~
    .../work/aspera/transfer-sdk/linux-amd64/connectors/cpp/transfer.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
    #error incompatible with your Protocol Buffer headers. Please
      ^~~~~
    .../work/aspera/transfer-sdk/linux-amd64/connectors/cpp/transfer.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
    #error regenerate this file with a newer version of protoc.

According to the errors of make I am not sure which version of protobuf does it want?

What more information should I provide here?
Please help.

Aquarius_Girl 10-22-2020 09:42 AM

Protobuf compiler version 3.0.0 doesn't match library version 2.6.1 - Aspera Transfer SDK
 
I am attempting to compile the sample programs from this tar ball: https://api.ibm.com/explorer/catalog...k/doc/overview


Code:

    $ cmake ..
    -- The C compiler identification is GNU 7.5.0
    -- The CXX compiler identification is GNU 7.5.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    CMake Warning at /usr/local/share/cmake-3.16/Modules/FindProtobuf.cmake:499 (message):
      Protobuf compiler version 3.0.0 doesn't match library version 2.6.1
    Call Stack (most recent call first):
      CMakeLists.txt:11 (include)
   
   
    -- Found Protobuf: /usr/local/lib/libprotobuf.so;-lpthread (found version "2.6.1")
    CMake Warning at /usr/local/share/cmake-3.16/Modules/FindProtobuf.cmake:499 (message):
      Protobuf compiler version 3.0.0 doesn't match library version 2.6.1
    Call Stack (most recent call first):
      CMakeLists.txt:12 (find_package)
   
   
    -- Configuring done
    -- Generating done

What does this error message mean? How am I supposed to upgrade libprotobuf.so found in /usr/local/lib?

Does this mean I am supposed to download and compile protobuf by source? Currently I installed it through apt-get.

I am on Ubuntu 18.04.

Code:

    ~$ which protoc
    /usr/bin/protoc
   
    ~$ protoc --version
    libprotoc 3.0.0


business_kid 10-22-2020 12:13 PM

Protobuf is in cmake. If there's a protobuf in your download, there could be a version mismatch. With the typical linux 3 figure versions package-x.y.z, in increment in a number means as follows

z+1 = bug fix
y+1 = feature addition
x+1 = compatability break.

So somehow protobuf-2.n.n is being asked to talk to protobuf-3.n.n and they're incompatible.

Aquarius_Girl 10-23-2020 12:56 AM

I realized that:
Quote:

Found Protobuf: /usr/local/lib/libprotobuf.so;-lpthread (found version "2.6.1")
What should be done to install version 3 of libprotobuf.so?

business_kid 10-23-2020 03:44 AM

It should be in cmake. If not find out if your (undisclosed) distro installs it se[paraltely. You mat want to check the lib is found by stuff also.

Aquarius_Girl 10-23-2020 08:01 AM

I deleted this .so manually, and manually installed version 3.13.1.
That solved this problem.


All times are GMT -5. The time now is 08:55 AM.