Max Frai
Max Frai

Reputation: 64356

Google protobuf in Linux

I'm working with protobuf and Linux. Where is its compiler protoc? I've downloaded the package from the main site, compiled and installed it successfully but I can't find protoc to build my own format file. Where is it?

UPDATE Here is 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

There isn't a binary file I need.

Upvotes: 9

Views: 43110

Answers (5)

Abdelrahman Yosry
Abdelrahman Yosry

Reputation: 101

Actually you don't need to know it's place. All you want is to open terminal where your proto file is located and write at terminal

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

follow this link for documentation

Upvotes: 0

MYLOGOS
MYLOGOS

Reputation: 681

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

./configure  
make   
make check   
make install

Second:

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

Read README.txt in root folder for more info.

Upvotes: 3

Milo
Milo

Reputation: 1

You can find protoc in the path which you set ./configure --prefix=you_path. When you make install successful, it will general bin, include and lib in that path.

Upvotes: 0

Dirk is no longer here
Dirk is no longer here

Reputation: 368489

Also, if you are in fact on Ubuntu, then you can also fetch the source package from Debian unstable and rebuild them locally if you want packages that are more current than the last cutoff (which for Ubuntu 9.10 was some time late last summer). That way you end up with .deb packages and you preserve a normal upgrade path (rather than littering /usr/local with one-off installs).

Upvotes: 1

daveb
daveb

Reputation: 76261

It's probably installed into /usr/local/bin

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

From the INSTALL.txt:

Installation Names

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

Upvotes: 27

Related Questions