3

I'm trying to build mosh from source on a SUSE10 machine and am getting the following error:

checking for protobuf... no
configure: error: Package requirements (protobuf) were not met:

No package 'protobuf' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables protobuf_CFLAGS
and protobuf_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I downloaded the source to protobuf and installed it in a custom path as well. I'm not using a package manager for any of this and cannot for various reasons outside the scope of the question. I added that custom path to my PATH and rehashed. Typically, this is enough for configure but in this case its not doing the trick. I added the prefix for protobuf to PKG_CONFIG_PATH but am still hitting this error.

What should I do next to get past this error?

terdon
  • 52,568
  • 14
  • 124
  • 170
dromodel
  • 287
  • 1
  • 4
  • 15
  • Your PATH should not be relevant here. Does the configure script have a `--lib-prefix` option? How did you add the path to PKG_CONFIG_PATH? – terdon Nov 07 '13 at 20:56
  • Have you looked at `config.log` yet? – Ignacio Vazquez-Abrams Nov 07 '13 at 21:03
  • Didn't look at config.log but have now. There was a suggestion buried in there that helped. Needed to point it to lib/pkgconfig. Never know how to read those log files and still don't but got enough out of it. Thanks! – dromodel Nov 08 '13 at 20:31

3 Answers3

6

To fix this, run it like this:

export PREFIX=~/usr   
PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig; 
./configure --prefix=${PREFIX}
Roney Michael
  • 1,056
  • 1
  • 14
  • 22
Max
  • 181
  • 4
0

You may need to install protobuf. Everything works fine after that .

https://github.com/google/protobuf

dsaju
  • 11
  • Welcome to Super User. The OP wrote "I downloaded the source to protobuf and installed it in a custom path as well". Your answer brings nothing new. – Kamil Maciorowski Dec 20 '16 at 19:42
  • @KamilMaciorowski People who are looking for answers skim the question. They may be confused by the name of two different packages: `protobuf` and `protobuf-c`. This answer will help. – Han Aug 21 '19 at 06:20
  • @Han The question doesn't mention protobuf-c. Even the answer doesn't mention it, so I really do not understand your comment. I still think the answer advises what has already been done. If not, it should explain the difference: what went wrong in the first try and why the laconic (if not trivial) "install protobuf" should help in the next try. The link is a generic link to protobuf on GitHub, so it doesn't shed any light either. – Kamil Maciorowski Aug 21 '19 at 06:49
  • @KamilMaciorowski I faced same issue (actually same error text), google led me here and this answer helped. This error showed when I tried installing `protobuf-c`. I was so confused why there was such problem like that till I realized that they are 2 different packages. I upvoted the answer. – Han Aug 22 '19 at 11:41
0

If anyone else gets stuck on this, I found a solution here: https://narkive.com/kRRnccDo.2

As part of installing protobuf, it should have installed a file called protobuf.pc, probably in /usr/local/lib/pkgconfig/protobuf.pc. Assuming that's where it is, try:

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure

I initially tried just installing the binary from the protobuf github, but that didn't include the protobuf.pc file. I ended up having to build protobuf from source and then executing PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure

This is similar, but not quite the same as Roney's solution above