I am working on Ubuntu 16.04 with R-version 3.4.2.
I want to install the R-Package "protolite" (more precisely, I want to install "tmap" where protolite is a prerequisite). I have libprotocol version 2.6.1 installed:
$ protoc --version
returns libprotoc 2.6.1.
When I type install.packages "protolite" , R gives me the warning:
Package protobuf was not found in the pkg-config search path.
Perhaps you should add the directory containing 'protobuf.pc'
to the PKG_CONFIG_PATH environment variable
No package 'protobuf' found
Later the installation fails with
/usr/bin/ld: cannot find -lprotobuf
collect2: error: ld returned 1 exit status
Since libprotocoll is installed, I searched for the pc file by
apt-file search protobuf.pc
which returned
libprotobuf-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/protobuf.pc
So I added
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
however, this did not resolve the issue. Can somebody help me out?
Note: I spent hours trying to install "tmap" by now, at first my problem was that I had installed libprotocol 3.2, which I had to delete to install tmap/protolite because the installation required libprotocol 2.6.1. So maybe this deletion/new installation brought some things in disorder on my computer.
Using
sudo apt-get install -y libprotobuf-dev protobuf-compiler
worked for me.
For anyone having the same problem. I checked with the Synaptic Package manager and found that not all libprotobuf versions were installed. In fact, just a lite version had been installed. Installing all "libprotobuf-dev 2.6.1-1.3 made it work.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.