невозможно сделать 'protobuf-c' предупреждает: пакет 'protobuf' не найден

1950
Feroze Mohamed

Я пытаюсь собрать protobuf-C отсюда https://github.com/protobuf-c

но я в итоге получил эту ошибку.

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. 

Я попробовал предложения из других постов, чтобы добавить PKG_CONFIG_PATH. но мне любопытно, если это потому, что у меня последняя версия protobuf, чем ожидалось?

из журнала конфигурации:

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 

Когда я пытаюсь найти протобуф, он хорошо показывает путь

# 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 

работает на: armv7l 4.1.15-tx6 + g77f6154 Yocto Linux

1

1 ответ на вопрос

2
Feroze Mohamed

Попробовав много предложений в Интернете, я наткнулся на китайский сайт, который предложил добавить этот путь:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig 

До сих пор я добавил строку ниже и не работал

export PKG_CONFIG_PATH=/usr/lib/pkgconfig 

После добавления этой строки экспортируйте PKG_CONFIG_PATH = / usr / local / lib / pkgconfig

./configure был успешным

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 

Похожие вопросы