1

I am installing protobuf-c 1.3.2

after ./configure it shows

    protobuf-c 1.3.2

        CC:                     gcc
        CFLAGS:                 -g -O2
        CXX:                    g++ -std=c++11
        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.8.0

but pkg-config --cflags 'libprotobuf >= 1.0.0' is not working. it says

Package libprotobuf was not found in the pkg-config search path.
Perhaps you should add the directory containing `libprotobuf.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libprotobuf' found

pkg-config --variable pc_path pkg-config shows

/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
2
  • 1
    What is the problem you are trying to solve, exactly? Why do you believe that your pkg-config command should work? Jul 8, 2019 at 11:48
  • hey, when i am installing with make install i got permission issues, which i forgot to mention. I uninstalled and installed again with sudo access. And now its woring fine.
    – Lohit raj
    Jul 9, 2019 at 6:26

2 Answers 2

1

Why do you want to build the protobuf-c Ubuntu repository package from source? It's a good practice and more convenient to prefer installing Ubuntu repository packages with apt instead of downloading them and compiling them. protobuf-c gets automatically updated when an update becomes available if you install it with apt. So you see it's more secure to install it with apt both ways.

To install Protocol Buffers C compiler (protobuf-c) in all currently supported versions of Ubuntu open the terminal and type:

sudo apt install protobuf-c-compiler  

In Ubuntu 18.04 this command installs version 1.2.1 of protobuf-c, and in Ubuntu 19.04 this installs version 1.3.1.

Protocol Buffers are a flexible, efficient, automated mechanism for serializing structured data - similar to XML, but smaller, faster and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages. You can even update your data structure without breaking deployed programs that are compiled against the "old" format.

1
  • Thanks karel, sorry i didn't put my make status. Thanks anyway.
    – Lohit raj
    Jul 9, 2019 at 6:19
0

make install shows

make  install-am
make[1]: Entering directory '/home/lohit/Documents/practise/protobuf-c'
make[2]: Entering directory '/home/lohit/Documents/practise/protobuf-c'
 /bin/mkdir -p '/usr/local/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   protobuf-c/libprotobuf-c.la '/usr/local/lib'
libtool: install: /usr/bin/install -c protobuf-c/.libs/libprotobuf-c.so.1.0.0 /usr/local/lib/libprotobuf-c.so.1.0.0
/usr/bin/install: cannot remove '/usr/local/lib/libprotobuf-c.so.1.0.0': Permission denied
make[2]: *** [Makefile:1103: install-libLTLIBRARIES] Error 1
make[2]: Leaving directory '/home/lohit/Documents/practise/protobuf-c'
make[1]: *** [Makefile:2192: install-am] Error 2
make[1]: Leaving directory '/home/lohit/Documents/practise/protobuf-c'
make: *** [Makefile:2186: install] Error 2

There is no permission to access the path. make uninstall && sudo make install worked.

1
  • This is the standard way of compiling all .tar.gz packages from source, but the question remains why did you compile protobuf-c from source instead of installing it with apt? It's a good practice and more convenient to prefer installing Ubuntu repository packages with apt instead of downloading them and compiling them.
    – karel
    Jul 9, 2019 at 6:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .