Closed oracle1521 closed 5 years ago
装protobuf了吗?
装了依旧报错呢
make[1]: Entering directory `/home/ops/pika/third/pink/pink' In file included from src/pb_conn.cc:6:0: ../pink/include/pb_conn.h:12:37: fatal error: google/protobuf/message.h: No such file or directory
^
compilation terminated. GEN src/build_version.cc CXX src/pb_cli.o src/pb_cli.cc:9:37: fatal error: google/protobuf/message.h: No such file or directory
^
compilation terminated. make[1]: [src/pb_cli.o] Error 1 make[1]: Leaving directory `/home/ops/pika/third/pink/pink' make: [/home/ops/pika/third/pink/pink/lib/libpink.a] Error 2 $ rpm -qa |grep protobuf protobuf-2.5.0-8.el7.x86_64
make distclean 然后再make
make distclean报错,之后make还是报错
[ops@localhost pika]$ make distclean
updating submodule
rm -rf /home/ops/pika/output
rm -rf /home/ops/pika/make_config.mk /home/ops/pika/src/build_version.cc
rm -rf /home/ops/pika/src/pika_inner_message.pb.cc /home/ops/pika/src/pika_inner_message.pb.h
find /home/ops/pika/src -name ".[oda]" -exec rm -f {} \;
find /home/ops/pika/src -type f -regex "..((gcda)|(gcno))" -exec rm {} \;
make -C /home/ops/pika/third/pink/pink/ SLASH_PATH=/home/ops/pika/third/slash clean
make[1]: Entering directory /home/ops/pika/third/pink/pink' make -C ./examples clean make[2]: Entering directory
/home/ops/pika/third/pink/pink/examples'
Makefile:12: Warning: missing pink path, using default
find . -name ".[oda]" -exec rm -f {} \;
rm -rf ./bg_thread ./http_server ./https_server ./mydispatch_srv ./myholy_srv \
./myholy_srv_chandle ./myproto_cli ./redis_cli_test ./simple_http_server \
./redis_parser_test ./myredis_srv ./binlog_parser_test ./thread_pool_test
make[2]: Leaving directory /home/ops/pika/third/pink/pink/examples' rm -f ./lib/libpink.a rm -rf src/build_version.cc rm -rf ./lib rm -f test/pink_thread_test find . -name "*.[oda]*" ! -path "./third/*" -exec rm -f {} \; find . -type f -regex ".*\.\(\(gcda\)\|\(gcno\)\)" -exec rm {} \; make[1]: Leaving directory
/home/ops/pika/third/pink/pink'
make -C /home/ops/pika/third/slash/slash/ clean
make[1]: Entering directory /home/ops/pika/third/slash/slash' make -C ./examples clean make[2]: Entering directory
/home/ops/pika/third/slash/slash/examples'
find . -name ".[oda]" -exec rm -f {} \;
rm -rf ./conf_example ./cond_lock_example ./binlog_example ./mutex_example ./hash_example
make[2]: Leaving directory /home/ops/pika/third/slash/slash/examples' rm -f slash_string_test slash_binlog_test slash_coding_test base_conf_test slash_env_test conf_example cond_lock_example binl og_example mutex_example hash_examplerm -f lib/libslash.a rm -rf src/build_version.cc rm -rf lib find . -name "*.[oda]*" -exec rm -f {} \; find . -type f -regex ".*\.\(\(gcda\)\|\(gcno\)\)" -exec rm {} \; make[1]: Leaving directory
/home/ops/pika/third/slash/slash'
make -C /home/ops/pika/third/blackwidow/ clean
make[1]: Entering directory /home/ops/pika/third/blackwidow' Makefile:36: Warning: missing rocksdb path, using default Makefile:43: Warning: missing slash path, using default make -C ./examples clean make[2]: Entering directory
/home/ops/pika/third/blackwidow/examples'
Makefile:14: Warning: missing blackwidow path, using default
Makefile:21: Warning: missing rocksdb path, using default
find . -name ".[oda]" -exec rm -f {} \;
rm -f ./make_config.mk
rm -rf ./strings_example ./hashes_example ./sets_example
make[2]: Leaving directory /home/ops/pika/third/blackwidow/examples' make -C ./tests clean make[2]: Entering directory
/home/ops/pika/third/blackwidow/tests'
Makefile:33: Warning: missing blackwidow path, using default
Makefile:40: Warning: missing rocksdb path, using default
Makefile:47: Warning: missing slash path, using default
Makefile:54: Warning: missing googletest path, using default
find . -name ".[oda]" -exec rm -f {} \;
rm -f ./make_config.mk
rm -rf db
rm -rf ./main ./lock_mgr ./gtest_keys ./gtest_strings ./gtest_hashes ./gtest_lists ./gtest_sets ./gtest_zsets ./gtest_strings
_filter ./gtest_hashes_filter ./gtest_hyperloglog ./gtest_lists_filter ./gtest_custom_comparatormake[2]: Leaving directory /home/ops/pika/third/blackwidow/tests' rm -f ./lib/libblackwidow.a rm -rf ./src/build_version.cc rm -rf ./lib find . -name "*.[oda]*" -path "./src/*" -exec rm -rf {} \; find . -type f -regex ".*\.\(\(gcda\)\|\(gcno\)\)" -exec rm {} \; make[1]: Leaving directory
/home/ops/pika/third/blackwidow'
make -C /home/ops/pika/third/rocksdb/ clean
make[1]: Entering directory /home/ops/pika/third/rocksdb' rm -f db_bench table_reader_bench cache_bench memtablerep_bench column_aware_encoding_exp persistent_cache_bench sst_dump db_ sanity_test db_stress write_stress ldb db_repl_stress rocksdb_dump rocksdb_undump blob_dump db_basic_test db_encryption_test db_test2 external_sst_file_basic_test auto_roll_logger_test bloom_test dynamic_bloom_test c_test checkpoint_test crc32c_test coding_test inlineskiplist_test env_basic_test env_test hash_test thread_local_test rate_limiter_test perf_context_test iostats_context_test db_wal_test db_block_cache_test db_test db_blob_index_test db_bloom_filter_test db_iter_test db_log_iter_test db_compaction_filter_test db_compaction_test db_dynamic_level_test db_flush_test db_inplace_update_test db_iterator_test db_memtable_test db_merge_operator_test db_options_test db_range_del_test db_sst_test db_tailing_iter_test db_universal_compaction_test db_io_failure_test db_properties_test db_table_properties_test db_statistics_test db_write_test autovector_test blob_db_test cleanable_test column_family_test table_properties_collector_test arena_test block_test cache_test corruption_test slice_transform_test dbformat_test fault_injection_test filelock_test filename_test file_reader_writer_test block_based_filter_block_test full_filter_block_test partitioned_filter_block_test hash_table_test histogram_test log_test manual_compaction_test mock_env_test memtable_list_test merge_helper_test memory_test merge_test merger_test util_merge_operators_test options_file_test redis_test reduce_levels_test plain_table_db_test comparator_db_test external_sst_file_test prefix_test skiplist_test write_buffer_manager_test stringappend_test cassandra_format_test cassandra_functional_test cassandra_row_merge_test cassandra_serialize_test ttl_test date_tiered_test backupable_db_test document_db_test json_document_test sim_cache_test spatial_db_test version_edit_test version_set_test compaction_picker_test version_builder_test file_indexer_test write_batch_test write_batch_with_index_test write_controller_test deletefile_test table_test geodb_test delete_scheduler_test options_test options_settable_test options_util_test event_logger_test timer_queue_test cuckoo_table_builder_test cuckoo_table_reader_test cuckoo_table_db_test flush_job_test wal_manager_test listener_test compaction_iterator_test compaction_job_test thread_list_test sst_dump_test column_aware_encoding_test compact_files_test optimistic_transaction_test write_callback_test heap_test compact_on_deletion_collector_test compaction_job_stats_test option_change_migration_test transaction_test ldb_cmd_test persistent_cache_test statistics_test lua_test range_del_aggregator_test lru_cache_test object_registry_test repair_test env_timed_test write_prepared_transaction_test librocksdb.a librocksdb.so librocksdb.so.5 librocksdb.so.5.9 librocksdb.so.5.9.2rm -rf make_config.mk shared-objects t LOG /dev/shm/rocksdb.1YNN unity.cc jls jl ios-x86 ios-arm scan_build_report find . -name "*.[oda]" -exec rm -f {} \; find . -type f -regex ".*\.\(\(gcda\)\|\(gcno\)\)" -exec rm {} \; rm -rf bzip2* snappy* zlib* lz4* zstd* cd java; make clean make[2]: Entering directory
/home/ops/pika/third/rocksdb/java'
rm -rf include/*
rm -rf test-libs/
rm -rf target
rm -rf benchmark/target
rm -rf samples/target
make[2]: Leaving directory /home/ops/pika/third/rocksdb/java' make[1]: Leaving directory
/home/ops/pika/third/rocksdb'
make -C /home/ops/pika/third/protobuf/ clean
make[1]: Entering directory /home/ops/pika/third/protobuf' make[1]: *** No rule to make target
clean'. Stop.
make[1]: Leaving directory `/home/ops/pika/third/protobuf'
make: *** [distclean] Error 2
[ops@localhost pika]$ make
updating submodule
make[1]: Entering directory /home/ops/pika/third/slash/slash' GEN src/build_version.cc make[1]: Leaving directory
/home/ops/pika/third/slash/slash'
make[1]: Entering directory /home/ops/pika/third/slash/slash' GEN src/build_version.cc CXX src/build_version.o CXX src/env.o CXX src/slash_testharness.o CXX src/posix.o CXX src/cond_lock.o CXX src/rsync.o CXX src/slash_mutex.o CXX src/slash_binlog_impl.o CXX src/slash_coding.o CXX src/slash_hash.o CXX src/testutil.o CXX src/slash_status.o CXX src/base_conf.o CXX src/slash_string.o AR lib/libslash.a ar: creating lib/libslash.a make[1]: Leaving directory
/home/ops/pika/third/slash/slash'
make[1]: Entering directory `/home/ops/pika/third/pink/pink'
In file included from src/pb_conn.cc:6:0:
../pink/include/pb_conn.h:12:37: fatal error: google/protobuf/message.h: No such file or directory
^
compilation terminated.
GEN src/build_version.cc
make[1]: Leaving directory /home/ops/pika/third/pink/pink' make[1]: Entering directory
/home/ops/pika/third/pink/pink'
In file included from src/pb_conn.cc:6:0:
../pink/include/pb_conn.h:12:37: fatal error: google/protobuf/message.h: No such file or directory
^
compilation terminated. GEN src/build_version.cc CXX src/build_version.o CXX src/server_thread.o CXX src/redis_conn.o CXX src/thread_pool.o CXX src/client_thread.o CXX src/pink_cli.o CXX src/pink_pubsub.o CXX src/dispatch_thread.o CXX src/server_socket.o CXX src/pink_thread.o CXX src/worker_thread.o CXX src/redis_cli.o CXX src/holy_thread.o CXX src/pink_epoll.o CXX src/pb_cli.o src/pb_cli.cc:9:37: fatal error: google/protobuf/message.h: No such file or directory
^
compilation terminated. make[1]: [src/pb_cli.o] Error 1 make[1]: Leaving directory `/home/ops/pika/third/pink/pink' make: [/home/ops/pika/third/pink/pink/lib/libpink.a] Error 2
protobuf装在哪个路径下了, 你看看
我是通过rpm包安装的,这个对路径有要求吗
protobuf-2.5.0-8.el7.x86_64
/usr/lib64/libprotobuf.so.8 /usr/lib64/libprotobuf.so.8.0.0 /usr/share/doc/protobuf-2.5.0 /usr/share/doc/protobuf-2.5.0/CHANGES.txt /usr/share/doc/protobuf-2.5.0/CONTRIBUTORS.txt /usr/share/doc/protobuf-2.5.0/COPYING.txt /usr/share/doc/protobuf-2.5.0/README.txt
你再找找google/protobuf/message.h这个头文件在哪个路径下面
在pika基目录 /third/protobuf/src/google/protobuf/message.h下
看一下/usr目录下面有protobuf相关的头文件吗, 你这个编译出错是编译pika的依赖库pink出了问题, 但是编译pink不会去pika对应的目录下找protobuf, 需要系统安装的
我protobuf采用编译安装了,编译路径为/usr/local/protobuf下
/usr/local/protobuf/include/google/protobuf
-rw-r--r--. 1 root root 59668 Jun 12 11:15 message.h 环境变量设置了以下几项: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/protobuf/lib export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/protobuf/lib export PATH=$PATH:/usr/local/protobuf/bin 这个还需要怎么设置呢?
谢谢大神指导,没搞过c++,太愚钝了 解决方式: 把编译后的include拷贝到/usr/local/include/或者/usr/include/下就ok了 ,后边还有个glog也会报错,方法等同。
...protobuf和glog都需要装的是 -devel 的包,那是头文件 不带 -devel 的是 .so
On ubuntu: sudo apt-get install libprotobuf-dev protobuf-compiler sudo apt install libgoogle-glog-dev
On ubuntu: sudo apt-get install libprotobuf-dev protobuf-compiler sudo apt install libgoogle-glog-dev
sudo apt install libsnappy-dev
export C_INCLUDE_PATH=/usr/local/protobuf/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/usr/local/protobuf/include:$CPLUS_INCLUDE_PATH
-------------- 请问一下我这个问题的原因是什么呢? ---------------
updating submodule make[1]: Entering directory `/root/pika/third/pink/pink' In file included from src/pb_conn.cc:6:0: ../pink/include/pb_conn.h:13:37: fatal error: google/protobuf/message.h: No such file or directory
^
compilation terminated.
GEN src/build_version.cc
make[1]: No rule to make target /etc/yum.repos.d/pika/third/slash/slash/include/slash_status.h', needed by
src/server_thread.o'. Stop.
make[1]: Leaving directory `/root/pika/third/pink/pink'
make: [/root/pika/third/pink/pink/lib/libpink.a] Error 2
@TankJam yum install protobuf-devel protobuf-compiler
你再找google/protobuf/message.h这个头文件在哪个路径下面
@TankJam yum install protobuf-devel protobuf-compiler
安装这个确实可以编译了 感谢
从git上clone master版本,根据安装提示,安装了必要的依赖包,在make的时候报以下错误,提示文件或目录不存在 相关log如下: make[1]: Leaving directory
/soft/pika_soft/pika/third/slash/slash' make[1]: Entering directory
/soft/pika_soft/pika/third/pink/pink' In file included from src/pb_conn.cc:6:0: ../pink/include/pb_conn.h:12:37: fatal error: google/protobuf/message.h: No such file or directoryinclude "google/protobuf/message.h"
compilation terminated. GEN src/build_version.cc make[1]: Leaving directory
/soft/pika_soft/pika/third/pink/pink' make[1]: Entering directory
/soft/pika_soft/pika/third/pink/pink' In file included from src/pb_conn.cc:6:0: ../pink/include/pb_conn.h:12:37: fatal error: google/protobuf/message.h: No such file or directoryinclude "google/protobuf/message.h"
compilation terminated. GEN src/build_version.cc CXX src/build_version.o CXX src/server_thread.o CXX src/redis_conn.o CXX src/thread_pool.o CXX src/client_thread.o CXX src/pink_cli.o CXX src/pink_pubsub.o CXX src/dispatch_thread.o CXX src/server_socket.o CXX src/pink_thread.o CXX src/worker_thread.o CXX src/redis_cli.o CXX src/holy_thread.o CXX src/pink_epoll.o CXX src/pb_cli.o src/pb_cli.cc:9:37: fatal error: google/protobuf/message.h: No such file or directory
include <google/protobuf/message.h>
compilation terminated. make[1]: [src/pb_cli.o] Error 1 make[1]: Leaving directory `/soft/pika_soft/pika/third/pink/pink' make: [/soft/pika_soft/pika/third/pink/pink/lib/libpink.a] Error 2
系统环境如下:
cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
rpm -qa | grep snappy-devel
snappy-devel-1.1.0-3.el7.x86_64
rpm -qa | grep glog-devel
glog-devel-0.3.3-8.el7.x86_64
rpm -qa | grep gcc-c++
gcc-c++-4.8.5-36.el7_6.2.x86_64
gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.