Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use vcpkg install absl dll lib link error #1705

Open
chengfang0911 opened this issue Jul 7, 2024 · 1 comment
Open

use vcpkg install absl dll lib link error #1705

chengfang0911 opened this issue Jul 7, 2024 · 1 comment

Comments

@chengfang0911
Copy link

chengfang0911 commented Jul 7, 2024

Describe the issue

txsim-coordinator.lib(sensor_catalog_parser.obj) : error LNK2001: 无法解析的外部符号 "private: static void const * const absl::lts_20240116::hash_internal::MixingHashState::kSeed" (?kSeed@MixingHashState@hash_internal@lts_20240116@absl@@0QEBXEB)
3>txsim-coordinator.lib(traffic_parser.obj) : error LNK2001: 无法解析的外部符号 "private: static void const * const absl::lts_20240116::hash_internal::MixingHashState::kSeed" (?kSeed@MixingHashState@hash_internal@lts_20240116@absl@@0QEBXEB)
3>txsim-coordinator.lib(coordinator.obj) : error LNK2001: 无法解析的外部符号 "private: static void const * const absl::lts_20240116::hash_internal::MixingHashState::kSeed" (?kSeed@MixingHashState@hash_internal@lts_20240116@absl@@0QEBXEB)
3>txsim-coordinator.lib(settings.pb.obj) : error LNK2001: 无法解析的外部符号 "private: static void const * const absl::lts_20240116::hash_internal::MixingHashState::kSeed" (?kSeed@MixingHashState@hash_internal@lts_20240116@absl@@0QEBXEB)
3>txsim-coordinator.lib(scene_sensor_group.pb.obj) : error LNK2001: 无法解析的外部符号 "private: static void const * const absl::lts_20240116::hash_internal::MixingHashState::kSeed" (?kSeed@MixingHashState@hash_internal@lts_20240116@absl@@0QEBXEB)
3>txsim-coordinator.lib(scene_infrastructure_group.pb.obj) : error LNK2001: 无法解析的外部符号 "private: static void const * const absl::lts_20240116::hash_internal::MixingHashState::kSeed" (?kSeed@MixingHashState@hash_internal@lts_20240116@absl@@0QEBXEB)

Steps to reproduce the problem

cmake already
find_package(absl CONFIG REQUIRED)
link with lib:absl::any absl::log absl::base absl::bits absl::hash absl::strings

What version of Abseil are you using?

{
"name": "abseil",
"version": "20240116.2",
"port-version": 2,
"description": [
"Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives.",
"In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we've found through usage in the Google code base. We denote those cases clearly within the library code we provide you.",
"Abseil is not meant to be a competitor to the standard library; we've just found that many of these utilities serve a purpose within our code base, and we now want to provide those resources to the C++ community as a whole."
],
"homepage": "https://github.com/abseil/abseil-cpp",
"license": "Apache-2.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"cxx17": {
"description": "Enable compiler C++17."
}
}
}

What operating system and version are you using?

win11

What compiler and version are you using?

vs2022 build x64

What build system are you using?

windows

Additional context

vcpkg install absl and link protobuf code error.compile success but link error."
I already define ABSL_CONSUME_DLL
I can find kSeed in abseil_dll.lib
image
I guess maybe link with abseil_hash.lib but i can't find out in vcpkg install result.

@chengfang0911
Copy link
Author

I rebuild abseil-cpp-20240116.2 this version on vs2022,add all lib in vs project and link success.
C:\Program Files (x86)\absl\lib\absl_bad_any_cast_impl.lib
C:\Program Files (x86)\absl\lib\absl_bad_optional_access.lib
C:\Program Files (x86)\absl\lib\absl_bad_variant_access.lib
C:\Program Files (x86)\absl\lib\absl_base.lib
C:\Program Files (x86)\absl\lib\absl_city.lib
C:\Program Files (x86)\absl\lib\absl_civil_time.lib
C:\Program Files (x86)\absl\lib\absl_cord.lib
C:\Program Files (x86)\absl\lib\absl_cord_internal.lib
C:\Program Files (x86)\absl\lib\absl_cordz_functions.lib
C:\Program Files (x86)\absl\lib\absl_cordz_handle.lib
C:\Program Files (x86)\absl\lib\absl_cordz_info.lib
C:\Program Files (x86)\absl\lib\absl_cordz_sample_token.lib
C:\Program Files (x86)\absl\lib\absl_crc32c.lib
C:\Program Files (x86)\absl\lib\absl_crc_cord_state.lib
C:\Program Files (x86)\absl\lib\absl_crc_cpu_detect.lib
C:\Program Files (x86)\absl\lib\absl_crc_internal.lib
C:\Program Files (x86)\absl\lib\absl_debugging_internal.lib
C:\Program Files (x86)\absl\lib\absl_demangle_internal.lib
C:\Program Files (x86)\absl\lib\absl_die_if_null.lib
C:\Program Files (x86)\absl\lib\absl_examine_stack.lib
C:\Program Files (x86)\absl\lib\absl_exponential_biased.lib
C:\Program Files (x86)\absl\lib\absl_failure_signal_handler.lib
C:\Program Files (x86)\absl\lib\absl_flags_commandlineflag.lib
C:\Program Files (x86)\absl\lib\absl_flags_commandlineflag_internal.lib
C:\Program Files (x86)\absl\lib\absl_flags_config.lib
C:\Program Files (x86)\absl\lib\absl_flags_internal.lib
C:\Program Files (x86)\absl\lib\absl_flags_marshalling.lib
C:\Program Files (x86)\absl\lib\absl_flags_parse.lib
C:\Program Files (x86)\absl\lib\absl_flags_private_handle_accessor.lib
C:\Program Files (x86)\absl\lib\absl_flags_program_name.lib
C:\Program Files (x86)\absl\lib\absl_flags_reflection.lib
C:\Program Files (x86)\absl\lib\absl_flags_usage.lib
C:\Program Files (x86)\absl\lib\absl_flags_usage_internal.lib
C:\Program Files (x86)\absl\lib\absl_graphcycles_internal.lib
C:\Program Files (x86)\absl\lib\absl_hash.lib
C:\Program Files (x86)\absl\lib\absl_hashtablez_sampler.lib
C:\Program Files (x86)\absl\lib\absl_int128.lib
C:\Program Files (x86)\absl\lib\absl_kernel_timeout_internal.lib
C:\Program Files (x86)\absl\lib\absl_leak_check.lib
C:\Program Files (x86)\absl\lib\absl_log_entry.lib
C:\Program Files (x86)\absl\lib\absl_log_flags.lib
C:\Program Files (x86)\absl\lib\absl_log_globals.lib
C:\Program Files (x86)\absl\lib\absl_log_initialize.lib
C:\Program Files (x86)\absl\lib\absl_log_internal_check_op.lib
C:\Program Files (x86)\absl\lib\absl_log_internal_conditions.lib
C:\Program Files (x86)\absl\lib\absl_log_internal_fnmatch.lib
C:\Program Files (x86)\absl\lib\absl_log_internal_format.lib
C:\Program Files (x86)\absl\lib\absl_log_internal_globals.lib
C:\Program Files (x86)\absl\lib\absl_log_internal_log_sink_set.lib
C:\Program Files (x86)\absl\lib\absl_log_internal_message.lib
C:\Program Files (x86)\absl\lib\absl_log_internal_nullguard.lib
C:\Program Files (x86)\absl\lib\absl_log_internal_proto.lib
C:\Program Files (x86)\absl\lib\absl_log_severity.lib
C:\Program Files (x86)\absl\lib\absl_log_sink.lib
C:\Program Files (x86)\absl\lib\absl_low_level_hash.lib
C:\Program Files (x86)\absl\lib\absl_malloc_internal.lib
C:\Program Files (x86)\absl\lib\absl_periodic_sampler.lib
C:\Program Files (x86)\absl\lib\absl_random_distributions.lib
C:\Program Files (x86)\absl\lib\absl_random_internal_distribution_test_util.lib
C:\Program Files (x86)\absl\lib\absl_random_internal_platform.lib
C:\Program Files (x86)\absl\lib\absl_random_internal_pool_urbg.lib
C:\Program Files (x86)\absl\lib\absl_random_internal_randen.lib
C:\Program Files (x86)\absl\lib\absl_random_internal_randen_hwaes.lib
C:\Program Files (x86)\absl\lib\absl_random_internal_randen_hwaes_impl.lib
C:\Program Files (x86)\absl\lib\absl_random_internal_randen_slow.lib
C:\Program Files (x86)\absl\lib\absl_random_internal_seed_material.lib
C:\Program Files (x86)\absl\lib\absl_random_seed_gen_exception.lib
C:\Program Files (x86)\absl\lib\absl_random_seed_sequences.lib
C:\Program Files (x86)\absl\lib\absl_raw_hash_set.lib
C:\Program Files (x86)\absl\lib\absl_raw_logging_internal.lib
C:\Program Files (x86)\absl\lib\absl_scoped_set_env.lib
C:\Program Files (x86)\absl\lib\absl_spinlock_wait.lib
C:\Program Files (x86)\absl\lib\absl_stacktrace.lib
C:\Program Files (x86)\absl\lib\absl_status.lib
C:\Program Files (x86)\absl\lib\absl_statusor.lib
C:\Program Files (x86)\absl\lib\absl_str_format_internal.lib
C:\Program Files (x86)\absl\lib\absl_strerror.lib
C:\Program Files (x86)\absl\lib\absl_string_view.lib
C:\Program Files (x86)\absl\lib\absl_strings.lib
C:\Program Files (x86)\absl\lib\absl_strings_internal.lib
C:\Program Files (x86)\absl\lib\absl_symbolize.lib
C:\Program Files (x86)\absl\lib\absl_synchronization.lib
C:\Program Files (x86)\absl\lib\absl_throw_delegate.lib
C:\Program Files (x86)\absl\lib\absl_time.lib
C:\Program Files (x86)\absl\lib\absl_time_zone.lib
C:\Program Files (x86)\absl\lib\absl_vlog_config_internal.lib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant