'protobuf-c' warnt nicht: Es wurde kein Paket 'protobuf' gefunden

2017
Feroze Mohamed

Ich versuche, die Protobuf-c von hier https://github.com/protobuf-c zu erstellen

Aber ich bekam diesen Fehler.

checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... no checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/arm-poky-linux-gnueabi/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether C compiler accepts "-Wc99-c11-compat"... yes checking whether C compiler accepts "-Werror=incompatible-pointer-types"... yes checking whether C compiler accepts "-Werror=int-conversion"... yes checking whether C compiler accepts "-Wnull-dereference"... no checking for doxygen... no checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for protobuf... no checking for protobuf... no configure: error: Package requirements (protobuf >= 2.6.0) were not met:  No package 'protobuf' found  Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. 

Ich habe Vorschläge aus anderen Beiträgen ausprobiert, um den PKG_CONFIG_PATH hinzuzufügen. aber ich bin neugierig, ob das so ist, weil ich die neueste protobuf-version als erwartet habe?

aus dem Konfigurationsprotokoll:

configure:16759: checking for pkg-config configure:16777: found /usr/bin/pkg-config configure:16789: result: /usr/bin/pkg-config configure:16814: checking pkg-config is at least version 0.9.0 configure:16817: result: yes configure:16879: checking for protobuf configure:16886: $PKG_CONFIG --exists --print-errors "protobuf >= 3.0.0" 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 configure:16889: $? = 1 configure:16903: $PKG_CONFIG --exists --print-errors "protobuf >= 3.0.0" 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 configure:16906: $? = 1 configure:16920: result: no No package 'protobuf' found configure:16938: checking for protobuf configure:16945: $PKG_CONFIG --exists --print-errors "protobuf >= 2.6.0" 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 configure:16948: $? = 1 configure:16962: $PKG_CONFIG --exists --print-errors "protobuf >= 2.6.0" 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 configure:16965: $? = 1 configure:16979: result: no No package 'protobuf' found configure:16995: error: Package requirements (protobuf >= 2.6.0) were not met:  No package 'protobuf' found 

Wenn ich versuche, den Protobuf zu finden, wird der Pfad gut angezeigt

# whereis pkgconfig pkgconfig: /usr/lib/pkgconfig /usr/local/lib/pkgconfig /usr/share/pkgconfig # echo $PKG_CONFIG_PATH usr/lib/pkgconfig # find / -name protobuf /usr/local/include/google/protobuf # protoc --version libprotoc 3.4.0 

läuft auf: armv7l 4.1.15-tx6 + g77f6154 Yocto Linux

1

1 Antwort auf die Frage

2
Feroze Mohamed

After trying many suggestions online i stumbled on a Chinese site which suggested adding this path:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig 

Till now i was adding the below line and didnt work

export PKG_CONFIG_PATH=/usr/lib/pkgconfig 

After adding this line, export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

./configure was successful

protobuf-c 1.3.0 CC: gcc CFLAGS: -g -O2 CXX: g++ CXXFLAGS: -g -O2 LDFLAGS: LIBS: prefix: /usr/local sysconfdir: $/etc libdir: $/lib includedir: $/include pkgconfigdir: $/pkgconfig bigendian: no protobuf version: libprotoc 3.4.0