unable to make the 'protobuf-c' warns : No package 'protobuf' found

6,447

After trying many suggestions online i stumbled on a Chinese site which suggested adding this path:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Till now i was adding the below line and didnt work

export PKG_CONFIG_PATH=/usr/lib/pkgconfig

After adding this line, export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

./configure was successful

protobuf-c 1.3.0

    CC:                     gcc
    CFLAGS:                 -g -O2
    CXX:                    g++
    CXXFLAGS:               -g -O2
    LDFLAGS:
    LIBS:

    prefix:                 /usr/local
    sysconfdir:             ${prefix}/etc
    libdir:                 ${exec_prefix}/lib
    includedir:             ${prefix}/include
    pkgconfigdir:           ${libdir}/pkgconfig

bigendian:              no
protobuf version:       libprotoc 3.4.0
Share:
6,447

Related videos on Youtube

Feroze Mohamed
Author by

Feroze Mohamed

Updated on September 18, 2022

Comments

  • Feroze Mohamed
    Feroze Mohamed almost 2 years

    I am trying to build the protobuf-c from here https://github.com/protobuf-c

    but i ended up getting this error.

    checking if g++ PIC flag -fPIC -DPIC works... yes
    checking if g++ static flag -static works... no
    checking if g++ supports -c -o file.o... yes
    checking if g++ supports -c -o file.o... (cached) yes
    checking whether the g++ linker (/usr/arm-poky-linux-gnueabi/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... (cached) GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether C compiler accepts "-Wc99-c11-compat"... yes
    checking whether C compiler accepts "-Werror=incompatible-pointer-types"... yes
    checking whether C compiler accepts "-Werror=int-conversion"... yes
    checking whether C compiler accepts "-Wnull-dereference"... no
    checking for doxygen... no
    checking for pkg-config... /usr/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for protobuf... no
    checking for protobuf... no
    configure: error: Package requirements (protobuf >= 2.6.0) were not met:
    
    No package 'protobuf' found
    
    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.
    

    I did try suggestions from other posts to add the PKG_CONFIG_PATH. but i am curious if this is because i have latest protobuf version than the expected ?

    from the config log :

    configure:16759: checking for pkg-config
    configure:16777: found /usr/bin/pkg-config
    configure:16789: result: /usr/bin/pkg-config
    configure:16814: checking pkg-config is at least version 0.9.0
    configure:16817: result: yes
    configure:16879: checking for protobuf
    configure:16886: $PKG_CONFIG --exists --print-errors "protobuf >= 3.0.0"
    Package protobuf was not found in the pkg-config search path.
    Perhaps you should add the directory containing `protobuf.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'protobuf' found
    configure:16889: $? = 1
    configure:16903: $PKG_CONFIG --exists --print-errors "protobuf >= 3.0.0"
    Package protobuf was not found in the pkg-config search path.
    Perhaps you should add the directory containing `protobuf.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'protobuf' found
    configure:16906: $? = 1
    configure:16920: result: no
    No package 'protobuf' found
    configure:16938: checking for protobuf
    configure:16945: $PKG_CONFIG --exists --print-errors "protobuf >= 2.6.0"
    Package protobuf was not found in the pkg-config search path.
    Perhaps you should add the directory containing `protobuf.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'protobuf' found
    configure:16948: $? = 1
    configure:16962: $PKG_CONFIG --exists --print-errors "protobuf >= 2.6.0"
    Package protobuf was not found in the pkg-config search path.
    Perhaps you should add the directory containing `protobuf.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'protobuf' found
    configure:16965: $? = 1
    configure:16979: result: no
    No package 'protobuf' found
    configure:16995: error: Package requirements (protobuf >= 2.6.0) were not met:
    
    No package 'protobuf' found
    

    When i try to find the protobuf it shows the path fine

    # whereis pkgconfig
    pkgconfig: /usr/lib/pkgconfig /usr/local/lib/pkgconfig /usr/share/pkgconfig
    # echo $PKG_CONFIG_PATH
    usr/lib/pkgconfig
    # find / -name protobuf
    /usr/local/include/google/protobuf
    # protoc --version
    libprotoc 3.4.0
    

    running on : armv7l 4.1.15-tx6+g77f6154 Yocto Linux