Google protobuf on Linux

I work with protobuf and Linux. Where is its protoc compiler. I downloaded the package from the main site, compiled and successfully installed it, but I can not find protoc to create my own format file. Where is it?

UPDATE Here is the folder where I built protobuf:

 aclocal.m4 depcomp Makefile.in autogen.sh editors missing CHANGES.txt examples protobuf-lite.pc config.guess generate_descriptor_proto.sh protobuf-lite.pc.in config.h gtest protobuf.pc config.h.in install-sh protobuf.pc.in config.log INSTALL.txt python config.status java README.txt config.sub libtool src configure ltmain.sh stamp-h1 configure.ac m4 vsprojects CONTRIBUTORS.txt Makefile COPYING.txt Makefile.am 

I do not need a binary file.

+8
c ++ protocol-buffers
source share
5 answers

It is probably installed in /usr/local/bin

In Ubuntu, at least you can apt-get install protobuf-compiler .

From the INSTALL.txt file:

Installation Names

By default, "make install" will install the package files in '/ usr / local / bin', '/ usr / local / man', etc. You can specify an installation prefix other than '/ usr / local' by specifying 'configure' option '--prefix = PATH'.

+25
source share

In addition, if you really use Ubuntu, you can also extract the source package from Debian unstable and rebuild it locally if you want the packages to be more current than the last cutoff (which for Ubuntu 9.10 was some time at the end of last summer). This way you get the .deb packages and you keep the normal update path (instead of trash / usr / local with one-time installations).

+1
source share

First you need to compile the source code from protobuff (in the root folder):

 ./configure make make check make install 

Secondly:

 echo "/usr/local/lib">>/etc/ld.so.conf echo "/usr/lib">>/etc/ld.so.conf ldconfig 

Third:

 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH 

For more information, read README.txt in the root folder.

+1
source share

You can find protoc in the path you specify. / configure --prefix = you_path. When you make the installation successful, it will be the shared bin, include, and lib in this path.

0
source share

In fact, you do not need to know this place. All you need to do is open the terminal where your proto file is located and write to the terminal

 protoc -I=. --cpp_out=. filename.proto 

follow this link for documentation

0
source share

All Articles