I'm trying to use gRPC directly in rocksdb's source code
LogAndApplyClient log_and_apply_client(grpc::CreateChannel(
secondary, grpc::InsecureChannelCredentials()));
log_and_apply_client is a basically class I wrote used for making rpcs calls, and it depends on the Stub Code generated by Protobuf. And I'm adding it directly into rocksdb's source code.
To resolve the grpc dependency, I'm adding dependency into rocksdb's CMakeLists.txt file using the CMakeLists example provided by the gRPC.
I installed gRPC and protobuf in Ubuntu18.04 and this is what I added to rocksdb's CMakeLists.
This basically finds grpc and protobuf's installation
# This branch assumes that gRPC and all its dependencies are already installed
# on this system, so they can be located by find_package().
# Find Protobuf installation
# Looks for protobuf-config.cmake file installed by Protobuf's cmake installation.
set(protobuf_MODULE_COMPATIBLE TRUE)
find_package(Protobuf CONFIG REQUIRED)
message(STATUS "Using protobuf ${Protobuf_VERSION}")
set(_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf)
set(_REFLECTION gRPC::grpc++_reflection)
if(CMAKE_CROSSCOMPILING)
find_program(_PROTOBUF_PROTOC protoc)
else()
set(_PROTOBUF_PROTOC $<TARGET_FILE:protobuf::protoc>)
endif()
# Find gRPC installation
# Looks for gRPCConfig.cmake file installed by gRPC's cmake installation.
find_package(gRPC CONFIG REQUIRED)
message(STATUS "Using gRPC ${gRPC_VERSION}")
set(_GRPC_GRPCPP gRPC::grpc++)
if(CMAKE_CROSSCOMPILING)
find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
else()
set(_GRPC_CPP_PLUGIN_EXECUTABLE $<TARGET_FILE:gRPC::grpc_cpp_plugin>)
endif()
Linking the rocksdb with grpc, protobuf
add_library(${ROCKSDB_STATIC_LIB} STATIC ${SOURCES})
target_link_libraries(${ROCKSDB_STATIC_LIB} PRIVATE
${THIRDPARTY_LIBS} ${SYSTEM_LIBS}
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF}
)
The Rocksdb compiles fine without error, but When I'm trying to use the compiled rocksdb library, It gives me a bunch of undefined reference.
mnt/sdb/my_rocksdb/librocksdb.a(version_set.cc.o): In function `__static_initialization_and_destruction_0(int, int)':
/mnt/sdb/my_rocksdb/db/version_set.cc:4325: undefined reference to `grpc::InsecureChannelCredentials()'
/mnt/sdb/my_rocksdb/db/version_set.cc:4324: undefined reference to `grpc::CreateChannel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<grpc::ChannelCredentials> const&)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:468: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:497: undefined reference to `google::protobuf::UnknownFieldSet::default_instance()'
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:497: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::ByteSizeLong() const':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:519: undefined reference to `google::protobuf::internal::ComputeUnknownFieldsSize(google::protobuf::internal::InternalMetadata const&, unsigned long, google::protobuf::internal::CachedSize*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::MergeFrom(google::protobuf::Message const&)':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:534: undefined reference to `google::protobuf::internal::ReflectionOps::Merge(google::protobuf::Message const&, google::protobuf::Message*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists_EditList_VersionEdit::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:705: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists_EditList_VersionEdit::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:744: undefined reference to `google::protobuf::UnknownFieldSet::default_instance()'
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:744: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet const&, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists::MergeFrom(google::protobuf::Message const&)':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:1206: undefined reference to `google::protobuf::internal::ReflectionOps::Merge(google::protobuf::Message const&, google::protobuf::Message*)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::NewFile_FileMetaData_FileDescriptor::_InternalParse(char const*, google::protobuf::internal::ParseContext*)':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:1378: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)'
/root/local/include/google/protobuf/unknown_field_set.h:312: undefined reference to `google::protobuf::UnknownFieldSet::ClearFallback()'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `google::protobuf::Message::Message()':
/root/local/include/google/protobuf/message.h:230: undefined reference to `vtable for google::protobuf::Message'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `google::protobuf::Message::Message(google::protobuf::Arena*)':
/root/local/include/google/protobuf/message.h:362: undefined reference to `vtable for google::protobuf::Message'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::GetMetadataStatic()':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.h:207: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists_EditList_VersionEdit::GetMetadataStatic()':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.h:344: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists_EditList::GetMetadataStatic()':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.h:510: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists::GetMetadataStatic()':
/mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.h:658: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply20NewFile_FileMetaDataE[_ZTVN8logapply20NewFile_FileMetaDataE]+0x98): undefined reference to `google::protobuf::Message::SpaceUsedLong() const'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE]+0x20): undefined reference to `google::protobuf::Message::GetTypeName[abi:cxx11]() const'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE]+0x48): undefined reference to `google::protobuf::Message::InitializationErrorString[abi:cxx11]() const'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE]+0x50): undefined reference to `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite const&)'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE]+0x90): undefined reference to `google::protobuf::Message::DiscardUnknownFields()'
(.data.rel.ro._ZTIN8logapply20NewFile_FileMetaDataE[_ZTIN8logapply20NewFile_FileMetaDataE]+0x10): undefined reference to `typeinfo for google::protobuf::Message'
/mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTIN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTIN8logapply35NewFile_FileMetaData_FileDescriptorE]+0x10): more undefined references to `typeinfo for google::protobuf::Message' follow
collect2: error: ld returned 1 exit status
CMakeFiles/primary_server.dir/build.make:143: recipe for target 'primary_server' failed
make[2]: *** [primary_server] Error 1
CMakeFiles/Makefile2:98: recipe for target 'CMakeFiles/primary_server.dir/all' failed
make[1]: *** [CMakeFiles/primary_server.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2
This is the CMakeLists file I wrote for my client program which uses the rocksdb library object
# Proto file
get_filename_component(kv_proto "../protos/keyvaluestore.proto" ABSOLUTE)
get_filename_component(kv_proto_path "${kv_proto}" PATH)
# Generated sources
set(kv_proto_srcs "${CMAKE_CURRENT_BINARY_DIR}/keyvaluestore.pb.cc")
set(kv_proto_hdrs "${CMAKE_CURRENT_BINARY_DIR}/keyvaluestore.pb.h")
set(kv_grpc_srcs "${CMAKE_CURRENT_BINARY_DIR}/keyvaluestore.grpc.pb.cc")
set(kv_grpc_hdrs "${CMAKE_CURRENT_BINARY_DIR}/keyvaluestore.grpc.pb.h")
add_custom_command(
OUTPUT "${kv_proto_srcs}" "${kv_proto_hdrs}" "${kv_grpc_srcs}" "${kv_grpc_hdrs}"
COMMAND ${_PROTOBUF_PROTOC}
ARGS --grpc_out "${CMAKE_CURRENT_BINARY_DIR}"
--cpp_out "${CMAKE_CURRENT_BINARY_DIR}"
-I "${kv_proto_path}"
--plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}"
"${kv_proto}"
DEPENDS "${kv_proto}")
# Include generated *.pb.h files
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
include_directories(/mnt/sdb/my_rocksdb/include)
link_directories(/mnt/sdb/my_rocksdb)
# kv_grpc_proto
add_library(kv_grpc_proto
${kv_grpc_srcs}
${kv_grpc_hdrs}
${kv_proto_srcs}
${kv_proto_hdrs})
target_link_libraries(kv_grpc_proto
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF}
)
# Targets greeter_[async_](client|server)
foreach(_target
kv_store_client
primary_server
)
add_executable(${_target} "${_target}.cc")
target_link_libraries(${_target}
kv_grpc_proto
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF}
liblog_and_apply_grpc_proto.a
librocksdb.a
)
endforeach()
I'm not quite familiar with cmake, I think I didn't get it right when I'm trying to add the dependency into rocksdb's source code and I'm really kind of stuck on this, so any suggestions will be appreciated !
The linker output seems is not linking libprotobuf.a and libgrpcpp.a
[100%] Linking CXX static library librocksdb.a
/usr/local/bin/cmake -P CMakeFiles/rocksdb.dir/cmake_clean_target.cmake
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/rocksdb.dir/link.txt --verbose=1
/usr/bin/ar qc librocksdb.a CMakeFiles/rocksdb.dir/cache/cache.cc.o CMakeFiles/rocksdb.dir/cache/clock_cache.cc.o CMakeFiles/rocksdb.dir/cache/lru_cache.cc.o CMakeFiles/rocksdb.dir/cache/sharded_cache.cc.o CMakeFiles/rocksdb.dir/db/arena_wrapped_db_iter.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_addition.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_builder.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_cache.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_garbage.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_meta.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_reader.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_log_format.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_log_sequential_reader.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_log_writer.cc.o CMakeFiles/rocksdb.dir/db/builder.cc.o CMakeFiles/rocksdb.dir/db/c.cc.o CMakeFiles/rocksdb.dir/db/column_family.cc.o CMakeFiles/rocksdb.dir/db/compacted_db_impl.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_iterator.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_picker.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_job.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_picker_fifo.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_picker_level.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_picker_universal.cc.o CMakeFiles/rocksdb.dir/db/compaction/sst_partitioner.cc.o CMakeFiles/rocksdb.dir/db/convenience.cc.o CMakeFiles/rocksdb.dir/db/db_filesnapshot.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_write.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_compaction_flush.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_files.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_open.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_debug.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_experimental.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_readonly.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_secondary.cc.o CMakeFiles/rocksdb.dir/db/db_info_dumper.cc.o CMakeFiles/rocksdb.dir/db/db_iter.cc.o CMakeFiles/rocksdb.dir/db/dbformat.cc.o CMakeFiles/rocksdb.dir/db/error_handler.cc.o CMakeFiles/rocksdb.dir/db/event_helpers.cc.o CMakeFiles/rocksdb.dir/db/experimental.cc.o CMakeFiles/rocksdb.dir/db/external_sst_file_ingestion_job.cc.o CMakeFiles/rocksdb.dir/db/file_indexer.cc.o CMakeFiles/rocksdb.dir/db/flush_job.cc.o CMakeFiles/rocksdb.dir/db/flush_scheduler.cc.o CMakeFiles/rocksdb.dir/db/forward_iterator.cc.o CMakeFiles/rocksdb.dir/db/import_column_family_job.cc.o CMakeFiles/rocksdb.dir/db/internal_stats.cc.o CMakeFiles/rocksdb.dir/db/logs_with_prep_tracker.cc.o CMakeFiles/rocksdb.dir/db/log_reader.cc.o CMakeFiles/rocksdb.dir/db/log_writer.cc.o CMakeFiles/rocksdb.dir/db/malloc_stats.cc.o CMakeFiles/rocksdb.dir/db/memtable.cc.o CMakeFiles/rocksdb.dir/db/memtable_list.cc.o CMakeFiles/rocksdb.dir/db/merge_helper.cc.o CMakeFiles/rocksdb.dir/db/merge_operator.cc.o CMakeFiles/rocksdb.dir/db/output_validator.cc.o CMakeFiles/rocksdb.dir/db/periodic_work_scheduler.cc.o CMakeFiles/rocksdb.dir/db/range_del_aggregator.cc.o CMakeFiles/rocksdb.dir/db/range_tombstone_fragmenter.cc.o CMakeFiles/rocksdb.dir/db/repair.cc.o CMakeFiles/rocksdb.dir/db/snapshot_impl.cc.o CMakeFiles/rocksdb.dir/db/table_cache.cc.o CMakeFiles/rocksdb.dir/db/table_properties_collector.cc.o CMakeFiles/rocksdb.dir/db/transaction_log_impl.cc.o CMakeFiles/rocksdb.dir/db/trim_history_scheduler.cc.o CMakeFiles/rocksdb.dir/db/version_builder.cc.o CMakeFiles/rocksdb.dir/db/version_edit.cc.o CMakeFiles/rocksdb.dir/db/version_edit_handler.cc.o CMakeFiles/rocksdb.dir/db/version_set.cc.o CMakeFiles/rocksdb.dir/db/wal_edit.cc.o CMakeFiles/rocksdb.dir/db/wal_manager.cc.o CMakeFiles/rocksdb.dir/db/write_batch.cc.o CMakeFiles/rocksdb.dir/db/write_batch_base.cc.o CMakeFiles/rocksdb.dir/db/write_controller.cc.o CMakeFiles/rocksdb.dir/db/write_thread.cc.o CMakeFiles/rocksdb.dir/env/env.cc.o CMakeFiles/rocksdb.dir/env/env_chroot.cc.o CMakeFiles/rocksdb.dir/env/env_encryption.cc.o CMakeFiles/rocksdb.dir/env/env_hdfs.cc.o CMakeFiles/rocksdb.dir/env/file_system.cc.o CMakeFiles/rocksdb.dir/env/file_system_tracer.cc.o CMakeFiles/rocksdb.dir/env/mock_env.cc.o CMakeFiles/rocksdb.dir/file/delete_scheduler.cc.o CMakeFiles/rocksdb.dir/file/file_prefetch_buffer.cc.o CMakeFiles/rocksdb.dir/file/file_util.cc.o CMakeFiles/rocksdb.dir/file/filename.cc.o CMakeFiles/rocksdb.dir/file/random_access_file_reader.cc.o CMakeFiles/rocksdb.dir/file/read_write_util.cc.o CMakeFiles/rocksdb.dir/file/readahead_raf.cc.o CMakeFiles/rocksdb.dir/file/sequence_file_reader.cc.o CMakeFiles/rocksdb.dir/file/sst_file_manager_impl.cc.o CMakeFiles/rocksdb.dir/file/writable_file_writer.cc.o CMakeFiles/rocksdb.dir/logging/auto_roll_logger.cc.o CMakeFiles/rocksdb.dir/logging/event_logger.cc.o CMakeFiles/rocksdb.dir/logging/log_buffer.cc.o CMakeFiles/rocksdb.dir/memory/arena.cc.o CMakeFiles/rocksdb.dir/memory/concurrent_arena.cc.o CMakeFiles/rocksdb.dir/memory/jemalloc_nodump_allocator.cc.o CMakeFiles/rocksdb.dir/memory/memkind_kmem_allocator.cc.o CMakeFiles/rocksdb.dir/memtable/alloc_tracker.cc.o CMakeFiles/rocksdb.dir/memtable/hash_linklist_rep.cc.o CMakeFiles/rocksdb.dir/memtable/hash_skiplist_rep.cc.o CMakeFiles/rocksdb.dir/memtable/skiplistrep.cc.o CMakeFiles/rocksdb.dir/memtable/vectorrep.cc.o CMakeFiles/rocksdb.dir/memtable/write_buffer_manager.cc.o CMakeFiles/rocksdb.dir/monitoring/histogram.cc.o CMakeFiles/rocksdb.dir/monitoring/histogram_windowing.cc.o CMakeFiles/rocksdb.dir/monitoring/in_memory_stats_history.cc.o CMakeFiles/rocksdb.dir/monitoring/instrumented_mutex.cc.o CMakeFiles/rocksdb.dir/monitoring/iostats_context.cc.o CMakeFiles/rocksdb.dir/monitoring/perf_context.cc.o CMakeFiles/rocksdb.dir/monitoring/perf_level.cc.o CMakeFiles/rocksdb.dir/monitoring/persistent_stats_history.cc.o CMakeFiles/rocksdb.dir/monitoring/statistics.cc.o CMakeFiles/rocksdb.dir/monitoring/thread_status_impl.cc.o CMakeFiles/rocksdb.dir/monitoring/thread_status_updater.cc.o CMakeFiles/rocksdb.dir/monitoring/thread_status_util.cc.o CMakeFiles/rocksdb.dir/monitoring/thread_status_util_debug.cc.o CMakeFiles/rocksdb.dir/options/cf_options.cc.o CMakeFiles/rocksdb.dir/options/configurable.cc.o CMakeFiles/rocksdb.dir/options/db_options.cc.o CMakeFiles/rocksdb.dir/options/options.cc.o CMakeFiles/rocksdb.dir/options/options_helper.cc.o CMakeFiles/rocksdb.dir/options/options_parser.cc.o CMakeFiles/rocksdb.dir/port/stack_trace.cc.o CMakeFiles/rocksdb.dir/table/adaptive/adaptive_table_factory.cc.o CMakeFiles/rocksdb.dir/table/block_based/binary_search_index_reader.cc.o CMakeFiles/rocksdb.dir/table/block_based/block.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_filter_block.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_table_builder.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_table_factory.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_table_iterator.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_table_reader.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_builder.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_prefetcher.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_prefix_index.cc.o CMakeFiles/rocksdb.dir/table/block_based/data_block_hash_index.cc.o CMakeFiles/rocksdb.dir/table/block_based/data_block_footer.cc.o CMakeFiles/rocksdb.dir/table/block_based/filter_block_reader_common.cc.o CMakeFiles/rocksdb.dir/table/block_based/filter_policy.cc.o CMakeFiles/rocksdb.dir/table/block_based/flush_block_policy.cc.o CMakeFiles/rocksdb.dir/table/block_based/full_filter_block.cc.o CMakeFiles/rocksdb.dir/table/block_based/hash_index_reader.cc.o CMakeFiles/rocksdb.dir/table/block_based/index_builder.cc.o CMakeFiles/rocksdb.dir/table/block_based/index_reader_common.cc.o CMakeFiles/rocksdb.dir/table/block_based/parsed_full_filter_block.cc.o CMakeFiles/rocksdb.dir/table/block_based/partitioned_filter_block.cc.o CMakeFiles/rocksdb.dir/table/block_based/partitioned_index_iterator.cc.o CMakeFiles/rocksdb.dir/table/block_based/partitioned_index_reader.cc.o CMakeFiles/rocksdb.dir/table/block_based/reader_common.cc.o CMakeFiles/rocksdb.dir/table/block_based/uncompression_dict_reader.cc.o CMakeFiles/rocksdb.dir/table/block_fetcher.cc.o CMakeFiles/rocksdb.dir/table/cuckoo/cuckoo_table_builder.cc.o CMakeFiles/rocksdb.dir/table/cuckoo/cuckoo_table_factory.cc.o CMakeFiles/rocksdb.dir/table/cuckoo/cuckoo_table_reader.cc.o CMakeFiles/rocksdb.dir/table/format.cc.o CMakeFiles/rocksdb.dir/table/get_context.cc.o CMakeFiles/rocksdb.dir/table/iterator.cc.o CMakeFiles/rocksdb.dir/table/merging_iterator.cc.o CMakeFiles/rocksdb.dir/table/meta_blocks.cc.o CMakeFiles/rocksdb.dir/table/persistent_cache_helper.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_bloom.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_builder.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_factory.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_index.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_key_coding.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_reader.cc.o CMakeFiles/rocksdb.dir/table/sst_file_dumper.cc.o CMakeFiles/rocksdb.dir/table/sst_file_reader.cc.o CMakeFiles/rocksdb.dir/table/sst_file_writer.cc.o CMakeFiles/rocksdb.dir/table/table_factory.cc.o CMakeFiles/rocksdb.dir/table/table_properties.cc.o CMakeFiles/rocksdb.dir/table/two_level_iterator.cc.o CMakeFiles/rocksdb.dir/test_util/sync_point.cc.o CMakeFiles/rocksdb.dir/test_util/sync_point_impl.cc.o CMakeFiles/rocksdb.dir/test_util/testutil.cc.o CMakeFiles/rocksdb.dir/test_util/transaction_test_util.cc.o CMakeFiles/rocksdb.dir/tools/block_cache_analyzer/block_cache_trace_analyzer.cc.o CMakeFiles/rocksdb.dir/tools/dump/db_dump_tool.cc.o CMakeFiles/rocksdb.dir/tools/io_tracer_parser_tool.cc.o CMakeFiles/rocksdb.dir/tools/ldb_cmd.cc.o CMakeFiles/rocksdb.dir/tools/ldb_tool.cc.o CMakeFiles/rocksdb.dir/tools/sst_dump_tool.cc.o CMakeFiles/rocksdb.dir/tools/trace_analyzer_tool.cc.o CMakeFiles/rocksdb.dir/trace_replay/trace_replay.cc.o CMakeFiles/rocksdb.dir/trace_replay/block_cache_tracer.cc.o CMakeFiles/rocksdb.dir/trace_replay/io_tracer.cc.o CMakeFiles/rocksdb.dir/util/coding.cc.o CMakeFiles/rocksdb.dir/util/compaction_job_stats_impl.cc.o CMakeFiles/rocksdb.dir/util/comparator.cc.o CMakeFiles/rocksdb.dir/util/compression_context_cache.cc.o CMakeFiles/rocksdb.dir/util/concurrent_task_limiter_impl.cc.o CMakeFiles/rocksdb.dir/util/crc32c.cc.o CMakeFiles/rocksdb.dir/util/dynamic_bloom.cc.o CMakeFiles/rocksdb.dir/util/hash.cc.o CMakeFiles/rocksdb.dir/util/murmurhash.cc.o CMakeFiles/rocksdb.dir/util/random.cc.o CMakeFiles/rocksdb.dir/util/rate_limiter.cc.o CMakeFiles/rocksdb.dir/util/slice.cc.o CMakeFiles/rocksdb.dir/util/file_checksum_helper.cc.o CMakeFiles/rocksdb.dir/util/status.cc.o CMakeFiles/rocksdb.dir/util/string_util.cc.o CMakeFiles/rocksdb.dir/util/thread_local.cc.o CMakeFiles/rocksdb.dir/util/threadpool_imp.cc.o CMakeFiles/rocksdb.dir/util/xxhash.cc.o CMakeFiles/rocksdb.dir/utilities/backupable/backupable_db.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_compaction_filter.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_db.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_db_impl.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_db_impl_filesnapshot.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_dump_tool.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_file.cc.o CMakeFiles/rocksdb.dir/utilities/cassandra/cassandra_compaction_filter.cc.o CMakeFiles/rocksdb.dir/utilities/cassandra/format.cc.o CMakeFiles/rocksdb.dir/utilities/cassandra/merge_operator.cc.o CMakeFiles/rocksdb.dir/utilities/checkpoint/checkpoint_impl.cc.o CMakeFiles/rocksdb.dir/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc.o CMakeFiles/rocksdb.dir/utilities/debug.cc.o CMakeFiles/rocksdb.dir/utilities/env_mirror.cc.o CMakeFiles/rocksdb.dir/utilities/env_timed.cc.o CMakeFiles/rocksdb.dir/utilities/fault_injection_env.cc.o CMakeFiles/rocksdb.dir/utilities/fault_injection_fs.cc.o CMakeFiles/rocksdb.dir/utilities/leveldb_options/leveldb_options.cc.o CMakeFiles/rocksdb.dir/utilities/memory/memory_util.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/bytesxor.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/max.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/put.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/sortlist.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/string_append/stringappend.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/string_append/stringappend2.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/uint64add.cc.o CMakeFiles/rocksdb.dir/utilities/object_registry.cc.o CMakeFiles/rocksdb.dir/utilities/option_change_migration/option_change_migration.cc.o CMakeFiles/rocksdb.dir/utilities/options/options_util.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/block_cache_tier.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/block_cache_tier_file.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/block_cache_tier_metadata.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/persistent_cache_tier.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/volatile_tier_impl.cc.o CMakeFiles/rocksdb.dir/utilities/simulator_cache/cache_simulator.cc.o CMakeFiles/rocksdb.dir/utilities/simulator_cache/sim_cache.cc.o CMakeFiles/rocksdb.dir/utilities/table_properties_collectors/compact_on_deletion_collector.cc.o CMakeFiles/rocksdb.dir/utilities/trace/file_trace_reader_writer.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/lock/lock_manager.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/lock/point/point_lock_tracker.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/lock/point/point_lock_manager.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/optimistic_transaction_db_impl.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/optimistic_transaction.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/pessimistic_transaction.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/pessimistic_transaction_db.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/snapshot_checker.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/transaction_base.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/transaction_db_mutex_impl.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/transaction_util.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/write_prepared_txn.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/write_prepared_txn_db.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/write_unprepared_txn.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/write_unprepared_txn_db.cc.o CMakeFiles/rocksdb.dir/utilities/ttl/db_ttl_impl.cc.o CMakeFiles/rocksdb.dir/utilities/write_batch_with_index/write_batch_with_index.cc.o CMakeFiles/rocksdb.dir/utilities/write_batch_with_index/write_batch_with_index_internal.cc.o CMakeFiles/rocksdb.dir/rubble/logAndApply/logAndApply.grpc.pb.cc.o CMakeFiles/rocksdb.dir/rubble/logAndApply/logAndApply.pb.cc.o CMakeFiles/rocksdb.dir/port/port_posix.cc.o CMakeFiles/rocksdb.dir/env/env_posix.cc.o CMakeFiles/rocksdb.dir/env/fs_posix.cc.o CMakeFiles/rocksdb.dir/env/io_posix.cc.o CMakeFiles/rocksdb.dir/third-party/folly/folly/detail/Futex.cpp.o CMakeFiles/rocksdb.dir/third-party/folly/folly/synchronization/AtomicNotification.cpp.o CMakeFiles/rocksdb.dir/third-party/folly/folly/synchronization/DistributedMutex.cpp.o CMakeFiles/rocksdb.dir/third-party/folly/folly/synchronization/ParkingLot.cpp.o CMakeFiles/rocksdb.dir/third-party/folly/folly/synchronization/WaitOptions.cpp.o CMakeFiles/rocksdb.dir/logAndApply.grpc.pb.cc.o CMakeFiles/rocksdb.dir/logAndApply.pb.cc.o CMakeFiles/build_version.dir/build_version.cc.o
/usr/bin/ranlib librocksdb.a
doing a grep on the output on grpc and protobuf didn't give me the library... So linker somehow fails to find the lib, which is confusing to me cause I did a
target_link_libraries(${ROCKSDB_STATIC_LIB} PRIVATE
${THIRDPARTY_LIBS} ${SYSTEM_LIBS}
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF}
)
in rocksdb's CMakeLists.
Related
When I build 'SuperCollider' on MacOS 12.5.1 using using XCode and -'std=gnu++17' using it's internal 'yaml-cpp' I get:
Undefined symbols for architecture x86_64:
"YAML::BadConversion::~BadConversion()", referenced from:
YAML::TypedBadConversion<bool>::~TypedBadConversion() in libsclang.a(SC_LanguageConfig.o)
YAML::TypedBadConversion<bool>::~TypedBadConversion() in libsclang.a(SC_LanguageConfig.o)
YAML::TypedBadConversion<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::~TypedBadConversion() in libsclang.a(PyrStringPrim.o)
YAML::TypedBadConversion<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::~TypedBadConversion() in libsclang.a(PyrStringPrim.o)
"YAML::detail::node_data::convert_to_map(std::__1::shared_ptr<YAML::detail::memory_holder> const&)", referenced from:
YAML::detail::node& YAML::detail::node_data::get<char const*>(char const* const&, std::__1::shared_ptr<YAML::detail::memory_holder>) in libsclang.a(SC_LanguageConfig.o)
"typeinfo for YAML::BadConversion", referenced from:
typeinfo for YAML::TypedBadConversion<bool> in libsclang.a(SC_LanguageConfig.o)
typeinfo for YAML::TypedBadConversion<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > in libsclang.a(PyrStringPrim.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
% nm ../lang/SuperCollider.build/RelWithDebInfo/libsclang.build/Objects-normal/x86_64/SC_LanguageConfig.o | grep Conversion
U __ZN4YAML13BadConversionD2Ev
0000000000004620 T __ZN4YAML18TypedBadConversionIbED0Ev
0000000000004610 T __ZN4YAML18TypedBadConversionIbED1Ev
U __ZTIN4YAML13BadConversionE
0000000000006658 S __ZTIN4YAML18TypedBadConversionIbEE
0000000000006e0e S __ZTSN4YAML18TypedBadConversionIbEE
0000000000006670 S __ZTVN4YAML18TypedBadConversionIbEE
When I build 'SuperCollider' using the system's yaml-cpp (from Macports) it builds properly.
When I build the 'yaml_cpp' project which is using '-std=gnu++11', it works:
https://github.com/jbeder/yaml-cpp
% nm ./RelWithDebInfo/libyaml-cpp.0.7.0.dylib | grep Conversion
00000000000117e0 T __ZN4YAML13BadConversionD0Ev
00000000000117b0 T __ZN4YAML13BadConversionD1Ev
0000000000011780 T __ZN4YAML13BadConversionD2Ev
00000000000308f8 S __ZTIN4YAML13BadConversionE
000000000002ea19 S __ZTSN4YAML13BadConversionE
00000000000308d0 S __ZTVN4YAML13BadConversionE
There's are differences in exceptions.h, and no 'exceptions.cpp' in SuperCollider/external_libraries, instead, it has 'exceptions.hpp':
% diff include/yaml-cpp ~/SuperCollider/external_libraries/yaml-cpp/include/yaml-cpp/ | grep Conversion
< class YAML_CPP_API BadConversion : public RepresentationException {
> class BadConversion : public RepresentationException {
< BadConversion(const BadConversion&) = default;
< ~BadConversion() YAML_CPP_NOEXCEPT override;
Is there an issue building projects with 'yaml-cpp' with '-std=gnu++17'?
Some other issue? (E.g. - 'SuperCollider' included the wrong version of 'yaml-cpp'?
When I build my gstreamer project using CMake I use the following CmakeLists.txt:
cmake_minimum_required(VERSION 3.16)
set(CMAKE_CXX_STANDARD 20)
include(FetchContent)
project(someproject)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GST REQUIRED gstreamer-1.0>=1.4
gstreamer-sdp-1.0>=1.4
gstreamer-video-1.0>=1.4
gstreamer-plugins-base-1.0>=1.4
gstreamer-app-1.0>=1.4
gstreamer-gl-1.0>=1.4)
#some other calls to find_package
add_library(someproject "")
#add source directories
target_include_directories(GUI_lib PUBLIC include "${OTHER_FIND_PACKAGE_INCLUDE_DIRS}"
"${GST_INCLUDE_DIRS}")
target_link_libraries(someproject PUBLIC "${OTHER_FIND_PACKAGE_LIBS}" "${GST_LIBRARIES}" -lGL -lepoxy)
This results in the following error:
in function `drawCallback(_GstElement*, unsigned int, unsigned int, unsigned int, void*)':
undefined reference to `gst_gl_filter_get_type'
undefined reference to `gst_gl_filter_draw_fullscreen_quad'
I have searched my gstreamer install and verified that there exists a shared library that defines these symbols using the following snippet (asterisks for emphasis):
% readelf -s --wide /usr/lib/gstreamer-1.0/libgstopengl.so | rg gl_filter
121: 0000000000000000 0 FUNC GLOBAL DEFAULT UND gst_gl_filter_render_to_target_with_shader
* 242: 0000000000000000 0 FUNC GLOBAL DEFAULT UND gst_gl_filter_draw_fullscreen_quad
305: 0000000000000000 0 FUNC GLOBAL DEFAULT UND gst_gl_filter_add_rgba_pad_templates
421: 0000000000000000 0 FUNC GLOBAL DEFAULT UND gst_gl_filter_render_to_target
* 447: 0000000000000000 0 FUNC GLOBAL DEFAULT UND gst_gl_filter_get_type
470: 0000000000000000 0 FUNC GLOBAL DEFAULT UND gst_gl_filter_filter_texture
So, I added the following to my CMake file:
add_library(gstopenglextras SHARED IMPORTED)
set_target_properties(gstopenglextras PROPERTIES
IMPORTED_LOCATION "/usr/lib/gstreamer-1.0/libgstopengl.so")
I also changed the target_link_libraries call to:
target_link_libraries(someproject PUBLIC "${OTHER_FIND_PACKAGE_LIBS}" gstopenglextras "${GST_LIBRARIES}" -lGL -lepoxy)
Now I get the following linker error:
/usr/bin/ld: undefined reference to symbol 'gst_gl_filter_get_type'
/usr/bin/ld: /usr/lib/libgstgl-1.0.so.0: error adding symbols: DSO missing from command line
I've read some stuff on circular dependencies and I've tried adding "${GST_LIBRARIES}" before gstopenglextras. However, this does not change the error.
Any ideas?
target_link_libraries(
someproject
PUBLIC
"${OTHER_FIND_PACKAGE_LIBS}"
gstopenglextras
"${GST_LIBRARIES}"
-lGL
-lepoxy
gstgl-1.0
glib-2.0
gmodule-2.0
)
is the call you need to fix this issue.
My link error:
Qt\Tools\mingw530_32\i686-w64-mingw32\include\comutil.h:278: erreur : undefined reference to `_com_util::ConvertStringToBSTR(char const*)#4'
Actually in .pro file:
LIBS += -lws2_32 -lwbemuuid -lole32
Which lib to add? lib comsuppw? Is it available for mingw?
Qt 5.10 - mingw32
The problem was due to the function bstr_t() in:
hres = pSvc->ExecQuery(
bstr_t("WQL"),
bstr_t("SELECT * FROM Win32_Process"),
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
NULL,
&pEnumerator);
The solution is to create BSTR strings directly:
BSTR bstr_wql = SysAllocString(L"WQL" );
BSTR bstr_sql = SysAllocString(L"SELECT * FROM Win32_Process" );
then use them,
hres = pSvc->ExecQuery(bstr_wql, bstr_sql, ...);
Don't forget to free the allocated memory strings after the query:
SysFreeString(bstr_wql);
SysFreeString(bstr_sql);
The linker is satisfied.
bstr_t(L"WQL") is work
I am trying to install aruco on my Windows machine using cmake 3.5.2 as suggested by the aruco developper.
My config:
Windows8
CMake 3.5.2
ArUco 2.0.5
I can configure and generate successfully aruco in cmake.
Then I go to aruco\build -> right click-> open cmd -> type mingw32-make -> get the following error:
C:\aruco-2.0.5\build>mingw32-make
Scanning dependencies of target aruco
[ 2%] Building CXX object src/CMakeFiles/aruco.dir/ar_omp.cpp.obj
[ 4%] Building CXX object src/CMakeFiles/aruco.dir/cameraparameters.cpp.obj
[ 6%] Building CXX object src/CMakeFiles/aruco.dir/cvdrawingutils.cpp.obj
In file included from C:\aruco-2.0.5\src\aruco.h:149:0,
from C:\aruco-2.0.5\src\cvdrawingutils.h:31,
from C:\aruco-2.0.5\src\cvdrawingutils.cpp:28:
C:\aruco-2.0.5\src\markerdetector.h:160:40: warning: "/*" within comment [-Wcomm
ent]
ARUCO_MIP_36h12, //**** recommended
^
C:\aruco-2.0.5\src\markerdetector.h:212:60: warning: unused parameter 'r2' [-Wun
used-parameter]
void setThresholdParamRange(size_t r1 = 0, size_t r2 = 0) {_params. _thresP
aram1_range = r1; }
^
C:\aruco-2.0.5\src\markerdetector.h:267:30: warning: unused parameter 'val' [-Wu
nused-parameter]
void setDesiredSpeed(int val){}
^
In file included from C:\aruco-2.0.5\src\posetracker.h:33:0,
from C:\aruco-2.0.5\src\aruco.h:150,
from C:\aruco-2.0.5\src\cvdrawingutils.h:31,
from C:\aruco-2.0.5\src\cvdrawingutils.cpp:28:
C:\aruco-2.0.5\src\markermap.h: In member function 'void aruco::Marker3DInfo::to
Stream(std::ostream&)':
C:\aruco-2.0.5\src\markermap.h:49:77: warning: comparison between signed and uns
igned integer expressions [-Wsign-compare]
void toStream(std::ostream &str){str<<id<<" "<<size()<<" ";for(int i=0;i<si
ze();i++) str<<at(i).x<<" "<<at(i).y<<" "<<at(i).z<<" ";}
^
In file included from C:\aruco-2.0.5\src\posetracker.h:33:0,
from C:\aruco-2.0.5\src\aruco.h:150,
from C:\aruco-2.0.5\src\cvdrawingutils.h:31,
from C:\aruco-2.0.5\src\cvdrawingutils.cpp:28:
C:\aruco-2.0.5\src\markermap.h: In member function 'void aruco::Marker3DInfo::fr
omStream(std::istream&)':
C:\aruco-2.0.5\src\markermap.h:50:80: warning: comparison between signed and uns
igned integer expressions [-Wsign-compare]
void fromStream(std::istream &str){int s;str>>id>>s;resize(s);for(int i=0;i
<size();i++) str>>at(i).x>>at(i).y>>at(i).z;}
^
[ 9%] Building CXX object src/CMakeFiles/aruco.dir/dictionary.cpp.obj
In file included from C:\aruco-2.0.5\src\dictionary.cpp:9:0:
C:\aruco-2.0.5\src\markermap.h: In member function 'void aruco::Marker3DInfo::to
Stream(std::ostream&)':
C:\aruco-2.0.5\src\markermap.h:49:77: warning: comparison between signed and uns
igned integer expressions [-Wsign-compare]
void toStream(std::ostream &str){str<<id<<" "<<size()<<" ";for(int i=0;i<si
ze();i++) str<<at(i).x<<" "<<at(i).y<<" "<<at(i).z<<" ";}
^
In file included from C:\aruco-2.0.5\src\dictionary.cpp:9:0:
C:\aruco-2.0.5\src\markermap.h: In member function 'void aruco::Marker3DInfo::fr
omStream(std::istream&)':
C:\aruco-2.0.5\src\markermap.h:50:80: warning: comparison between signed and uns
igned integer expressions [-Wsign-compare]
void fromStream(std::istream &str){int s;str>>id>>s;resize(s);for(int i=0;i
<size();i++) str>>at(i).x>>at(i).y>>at(i).z;}
^
C:\aruco-2.0.5\src\dictionary.cpp: In static member function 'static std::string
aruco::Dictionary::getTypeString(aruco::Dictionary::DICT_TYPES)':
C:\aruco-2.0.5\src\dictionary.cpp:236:11: warning: enumeration value 'ARTAG' not
handled in switch [-Wswitch]
switch(t){
^
C:\aruco-2.0.5\src\dictionary.cpp: In member function 'aruco::MarkerMap aruco::D
ictionary::createMarkerMap(cv::Size, int, int, const std::vector<int>&, bool)':
C:\aruco-2.0.5\src\dictionary.cpp:275:39: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
if (gridSize.height*gridSize.width!=ids.size())throw cv::Exception(9001, "g
ridSize != ids.size()Invalid ", "Dictionary::createMarkerMap", __FILE__, __LINE_
_);
^
C:\aruco-2.0.5\src\dictionary.cpp:284:23: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (int i=0;i<ids.size();i++) TInfo[i].id=ids[i];
^
C:\aruco-2.0.5\src\dictionary.cpp:285:13: warning: unused variable 'sizeY' [-Wun
used-variable]
int sizeY=gridSize.height*MarkerSize+(gridSize.height-1)*MarkerDistance
;
^
C:\aruco-2.0.5\src\dictionary.cpp:286:13: warning: unused variable 'sizeX' [-Wun
used-variable]
int sizeX=gridSize.width*MarkerSize+(gridSize.width-1)*MarkerDistance;
^
C:\aruco-2.0.5\src\dictionary.cpp:312:37: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
if (CurMarkerIdx>=ids.size()) throw cv::Exception(999," Fid
ucidalMarkers::createMarkerMapImage_ChessMarkerMap","INTERNAL ERROR. REWRITE THI
S!!",__FILE__,__LINE__);
^
C:\aruco-2.0.5\src\dictionary.cpp:300:13: warning: unused variable 'centerX' [-W
unused-variable]
int centerX=sizeX/2;
^
C:\aruco-2.0.5\src\dictionary.cpp:301:13: warning: unused variable 'centerY' [-W
unused-variable]
int centerY=sizeY/2;
^
C:\aruco-2.0.5\src\dictionary.cpp:303:14: warning: unused variable 'centerData'
[-Wunused-variable]
bool centerData=true;
^
[ 11%] Building CXX object src/CMakeFiles/aruco.dir/ippe.cpp.obj
C:\aruco-2.0.5\src\ippe.cpp: In function 'void IPPE::IPPComputeRotations(double,
double, double, double, double, double, cv::OutputArray, cv::OutputArray)':
C:\aruco-2.0.5\src\ippe.cpp:307:45: warning: variable 'ata10' set but not used [
-Wunused-but-set-variable]
double a00, a01, a10,a11, ata00, ata01, ata10,ata11,b00, b01, b10,b11,binv0
0, binv01, binv10,binv11;
^
C:\aruco-2.0.5\src\ippe.cpp:311:19: warning: variable 'a' set but not used [-Wun
used-but-set-variable]
double b0, b1,a,gamma,dtinv;
^
[ 13%] Building CXX object src/CMakeFiles/aruco.dir/marker.cpp.obj
C:\aruco-2.0.5\src\marker.cpp: In member function 'void aruco::Marker::rotateXAx
is(cv::Mat&)':
C:\aruco-2.0.5\src\marker.cpp:299:22: error: 'M_PI' was not declared in this sco
pe
float angleRad = M_PI / 2;
^
src\CMakeFiles\aruco.dir\build.make:187: recipe for target 'src/CMakeFiles/aruco
.dir/marker.cpp.obj' failed
mingw32-make[2]: *** [src/CMakeFiles/aruco.dir/marker.cpp.obj] Error 1
CMakeFiles\Makefile2:116: recipe for target 'src/CMakeFiles/aruco.dir/all' faile
d
mingw32-make[1]: *** [src/CMakeFiles/aruco.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
C:\aruco-2.0.5\build>mingw32-make
Scanning dependencies of target aruco
[ 2%] Building CXX object src/CMakeFiles/aruco.dir/marker.cpp.obj
C:\aruco-2.0.5\src\marker.cpp: In member function 'void aruco::Marker::rotateXAx
is(cv::Mat&)':
C:\aruco-2.0.5\src\marker.cpp:299:22: error: 'M_PI' was not declared in this sco
pe
float angleRad = M_PI / 2;
^
src\CMakeFiles\aruco.dir\build.make:187: recipe for target 'src/CMakeFiles/aruco
.dir/marker.cpp.obj' failed
mingw32-make[2]: *** [src/CMakeFiles/aruco.dir/marker.cpp.obj] Error 1
CMakeFiles\Makefile2:116: recipe for target 'src/CMakeFiles/aruco.dir/all' faile
d
mingw32-make[1]: *** [src/CMakeFiles/aruco.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
I have also tried to do it with codeblocks but I get the exact same error.
The developer has released a new version 2.0.7 fixing this issue.
What I have done to have aruco:
download the .zip on sourceforge
unzip it
create a build folder in aruco-2.0.7
open cmake-gui configure and generate
go into your build folder
open a cmd window from there
type mingw32-make
The library should have compiled properly.
If omp.h is missing from your compiler, find the source code on the internet and add it to mingw in MinGW\include. You should be ready to go. Don't forget to add aruco to your path & reboot.
If you are using an ide, you will have to add this library since it is an external library but it is another issue.
Finally, you might have some issues regarding c++11. I am working on it. If someone knows how to allow it on mingw (I haven't find any understandable explanation so far)
I'm trying to build dash using Clion and CMake but I get this build error:
/opt/clion-2016.1.1/bin/cmake/bin/cmake --build /home/dac/.CLion2016.1/system/cmake/generated/dash-46b33cad/46b33cad/Debug --target all -- -j 4
[ 3%] Building C object CMakeFiles/main.dir/error.c.o
[ 6%] Building C object CMakeFiles/main.dir/eval.c.o
[ 9%] Building C object CMakeFiles/main.dir/cd.c.o
[ 12%] Building C object CMakeFiles/main.dir/arith_yylex.c.o
In file included from /home/dac/Downloads/dash-0.5.8/dash/error.c:54:0:
/home/dac/Downloads/dash-0.5.8/dash/system.h:65:22: error: static declaration of ‘strtod’ follows non-static declaration
static inline double strtod(const char *nptr, char **endptr)
^
In file included from /home/dac/Downloads/dash-0.5.8/dash/error.c:40:0:
/usr/include/stdlib.h:164:15: note: previous declaration of ‘strtod’ was here
extern double strtod (const char *__restrict __nptr,
^
In file included from /home/dac/Downloads/dash-0.5.8/dash/error.c:54:0:
/home/dac/Downloads/dash-0.5.8/dash/system.h:86:19: error: static declaration of ‘killpg’ follows non-static declaration
static inline int killpg(pid_t pid, int signal)
^
In file included from /home/dac/Downloads/dash-0.5.8/dash/error.c:39:0:
/usr/include/signal.h:134:12: note: previous declaration of ‘killpg’ was here
extern int killpg (__pid_t __pgrp, int __sig) __THROW;
^
In file included from /home/dac/Downloads/dash-0.5.8/dash/error.c:54:0:
/home/dac/Downloads/dash-0.5.8/dash/system.h:97:0: warning: "_SC_CLK_TCK" redefined
#define _SC_CLK_TCK 2
^
In file included from /usr/include/unistd.h:609:0,
from /home/dac/Downloads/dash-0.5.8/dash/error.c:42:
/usr/include/x86_64-linux-gnu/bits/confname.h:78:0: note: this is the location of the previous definition
#define _SC_CLK_TCK _SC_CLK_TCK
^
CMakeFiles/main.dir/build.make:182: recipe for target 'CMakeFiles/main.dir/error.c.o' failed
make[2]: *** [CMakeFiles/main.dir/error.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/dac/Downloads/dash-0.5.8/dash/eval.c:51:22: fatal error: builtins.h: No such file or directory
In file included from /home/dac/Downloads/dash-0.5.8/dash/arith_yylex.c:44:0:
/home/dac/Downloads/dash-0.5.8/dash/system.h:65:22: error: static declaration of ‘strtod’ follows non-static declaration
static inline double strtod(const char *nptr, char **endptr)
^
In file included from /home/dac/Downloads/dash-0.5.8/dash/arith_yylex.c:36:0:
/usr/include/stdlib.h:164:15: note: previous declaration of ‘strtod’ was here
extern double strtod (const char *__restrict __nptr,
^
In file included from /home/dac/Downloads/dash-0.5.8/dash/arith_yylex.c:44:0:
/home/dac/Downloads/dash-0.5.8/dash/system.h:86:19: error: static declaration of ‘killpg’ follows non-static declaration
static inline int killpg(pid_t pid, int signal)
^
In file included from /home/dac/Downloads/dash-0.5.8/dash/error.h:38:0,
from /home/dac/Downloads/dash-0.5.8/dash/arith_yylex.c:40:
/usr/include/signal.h:134:12: note: previous declaration of ‘killpg’ was here
extern int killpg (__pid_t __pgrp, int __sig) __THROW;
^
In file included from /home/dac/Downloads/dash-0.5.8/dash/syntax.h:5:0,
from /home/dac/Downloads/dash-0.5.8/dash/arith_yylex.c:43:
/home/dac/Downloads/dash-0.5.8/dash/system.h:102:17: error: expected ‘)’ before ‘c’
int isblank(int c);
^
/home/dac/Downloads/dash-0.5.8/dash/system.h:102:5: error: expected expression before ‘)’ token
int isblank(int c);
^
compilation terminated.
CMakeFiles/main.dir/build.make:206: recipe for target 'CMakeFiles/main.dir/eval.c.o' failed
make[2]: *** [CMakeFiles/main.dir/eval.c.o] Error 1
CMakeFiles/main.dir/build.make:134: recipe for target 'CMakeFiles/main.dir/arith_yylex.c.o' failed
make[2]: *** [CMakeFiles/main.dir/arith_yylex.c.o] Error 1
My CMakeLists.txt looks like this:
cmake_minimum_required (VERSION 2.6)
project (dash)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include config.h -DBSD=1 -DSHELL -DIFS_BROKEN")
add_executable(main main.c alias.c arith_yacc.c arith_yylex.c cd.c error.c eval.c exec.c expand.c histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c mystring.c options.c parser.c redir.c show.c trap.c output.c bltin/printf.c system.c bltin/test.c bltin/times.c var.c alias.h arith_yacc.h bltin/bltin.h cd.h error.h eval.h exec.h expand.h hetio.h init.h input.h jobs.h machdep.h mail.h main.h memalloc.h miscbltin.h myhistedit.h mystring.h options.h output.h parser.h redir.h shell.h show.h system.h trap.h var.h mktokens mkbuiltins builtins.def.in mkinit.c mknodes.c nodetypes nodes.c.pat mksyntax.c mksignames.c)
What can I do to make it build? If I use the makefile and build with make then it builds. But I want to build with CMake.