Package libprotobuf was not found in the pkg-config search path
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.
Related videos on Youtube
![Lohit raj](https://lh4.googleusercontent.com/-SK3F1A2Pqe0/AAAAAAAAAAI/AAAAAAAAKjk/RD3MClftj80/photo.jpg?sz=256)
Lohit raj
Updated on September 18, 2022Comments
-
Lohit raj almost 2 years
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 saysPackage 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
-
steeldriver almost 5 yearsWhat is the problem you are trying to solve, exactly? Why do you believe that your pkg-config command should work?
-
Lohit raj almost 5 yearshey, 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 almost 5 yearsThanks karel, sorry i didn't put my make status. Thanks anyway.
-
karel almost 5 yearsThis 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.