Comments (9)
PR is welcome.
from spdlog.
This proposal was previously closed (#1257).
from spdlog.
This proposal was previously closed (#1257).
I see. I think that work should not be wasted.
from spdlog.
Currently either all symbols exported from every dll (so) uses the library, or there are linking errors. What if I link against two shared libraries compiled with two different versions of the spdlog? I suspect it will be a problem in current state.
from spdlog.
If the spdlog library is not exporting symbols, wouldn't your application not be able to find the symbols that spdlog was exporting when linking, resulting in a link error?
from spdlog.
This is true.
If I make default visibility hidden for the whole project (including external submodules, like spdlog), I get link errors, because spdlog not exporting at all.
If I don't make default visibility hidden (but default) for external submodules and spdlog is static then any my dll (so), that uses spdlog (effectively means "all dlls") exports these symbols:
nm -gDC --defined-only lib*.so | awk 'match($2, /D|T/) { print substr($0, index($0, $3)) }' | grep spdlog
spdlog::should_log(spdlog::level::level_enum) spdlog::set_pattern(std::__cxx11::basic_string, std::allocator >, spdlog::pattern_time_type) spdlog::async_logger::backend_flush_() spdlog::async_logger::backend_sink_it_(spdlog::details::log_msg const&) spdlog::async_logger::clone(std::__cxx11::basic_string, std::allocator >) spdlog::async_logger::flush_() spdlog::async_logger::sink_it_(spdlog::details::log_msg const&) spdlog::async_logger::async_logger(std::__cxx11::basic_string, std::allocator >, std::shared_ptr, std::weak_ptr, spdlog::async_overflow_policy) spdlog::async_logger::async_logger(std::__cxx11::basic_string, std::allocator >, std::initializer_list >, std::weak_ptr, spdlog::async_overflow_policy) spdlog::async_logger::async_logger(std::__cxx11::basic_string, std::allocator >, std::shared_ptr, std::weak_ptr, spdlog::async_overflow_policy) spdlog::async_logger::async_logger(std::__cxx11::basic_string, std::allocator >, std::initializer_list >, std::weak_ptr, spdlog::async_overflow_policy) spdlog::set_formatter(std::unique_ptr >) spdlog::default_logger() spdlog::dump_backtrace() spdlog::register_logger(std::shared_ptr) spdlog::throw_spdlog_ex(std::__cxx11::basic_string, std::allocator >) spdlog::throw_spdlog_ex(std::__cxx11::basic_string, std::allocator > const&, int) spdlog::enable_backtrace(unsigned long) spdlog::disable_backtrace() spdlog::initialize_logger(std::shared_ptr) spdlog::pattern_formatter::set_pattern(std::__cxx11::basic_string, std::allocator >) spdlog::pattern_formatter::need_localtime(bool) spdlog::pattern_formatter::handle_padspec_(__gnu_cxx::__normal_iterator, std::allocator > >&, __gnu_cxx::__normal_iterator, std::allocator > >) spdlog::pattern_formatter::compile_pattern_(std::__cxx11::basic_string, std::allocator > const&) spdlog::pattern_formatter::format(spdlog::details::log_msg const&, fmt::v10::basic_memory_buffer >&) spdlog::pattern_formatter::get_time_(spdlog::details::log_msg const&) spdlog::pattern_formatter::pattern_formatter(spdlog::pattern_time_type, std::__cxx11::basic_string, std::allocator >) spdlog::pattern_formatter::pattern_formatter(std::__cxx11::basic_string, std::allocator >, spdlog::pattern_time_type, std::__cxx11::basic_string, std::allocator >, std::unordered_map >, std::hash, std::equal_to, std::allocator > > > >) spdlog::pattern_formatter::pattern_formatter(spdlog::pattern_time_type, std::__cxx11::basic_string, std::allocator >) spdlog::pattern_formatter::pattern_formatter(std::__cxx11::basic_string, std::allocator >, spdlog::pattern_time_type, std::__cxx11::basic_string, std::allocator >, std::unordered_map >, std::hash, std::equal_to, std::allocator > > > >) spdlog::set_error_handler(void (*)(std::__cxx11::basic_string, std::allocator > const&)) spdlog::default_logger_raw() spdlog::set_default_logger(std::shared_ptr) spdlog::apply_logger_env_levels(std::shared_ptr) spdlog::set_automatic_registration(bool) spdlog::get(std::__cxx11::basic_string, std::allocator > const&) spdlog::drop(std::__cxx11::basic_string, std::allocator > const&) spdlog::swap(spdlog::logger&, spdlog::logger&) spdlog::level::to_short_c_str(spdlog::level::level_enum) spdlog::level::to_string_view(spdlog::level::level_enum) spdlog::level::from_str(std::__cxx11::basic_string, std::allocator > const&) spdlog::sinks::sink::set_level(spdlog::level::level_enum) spdlog::logger::set_pattern(std::__cxx11::basic_string, std::allocator >, spdlog::pattern_time_type) spdlog::logger::err_handler_(std::__cxx11::basic_string, std::allocator > const&) spdlog::logger::set_formatter(std::unique_ptr >) spdlog::logger::should_flush_(spdlog::details::log_msg const&) spdlog::logger::dump_backtrace() spdlog::logger::dump_backtrace_() spdlog::logger::enable_backtrace(unsigned long) spdlog::logger::disable_backtrace() spdlog::logger::set_error_handler(std::function, std::allocator > const&)>) spdlog::logger::swap(spdlog::logger&) spdlog::logger::clone(std::__cxx11::basic_string, std::allocator >) spdlog::logger::flush() spdlog::logger::sinks() spdlog::logger::flush_() spdlog::logger::log_it_(spdlog::details::log_msg const&, bool, bool) spdlog::logger::flush_on(spdlog::level::level_enum) spdlog::logger::sink_it_(spdlog::details::log_msg const&) spdlog::logger::set_level(spdlog::level::level_enum) spdlog::logger::operator=(spdlog::logger) spdlog::logger::logger(spdlog::logger&&) spdlog::logger::logger(spdlog::logger const&) spdlog::logger::logger(spdlog::logger&&) spdlog::logger::logger(spdlog::logger const&) spdlog::details::backtracer::foreach_pop(std::function) spdlog::details::backtracer::enable(unsigned long) spdlog::details::backtracer::disable() spdlog::details::backtracer::push_back(spdlog::details::log_msg const&) spdlog::details::backtracer::operator=(spdlog::details::backtracer) spdlog::details::backtracer::backtracer(spdlog::details::backtracer&&) spdlog::details::backtracer::backtracer(spdlog::details::backtracer const&) spdlog::details::backtracer::backtracer(spdlog::details::backtracer&&) spdlog::details::backtracer::backtracer(spdlog::details::backtracer const&) spdlog::details::thread_pool::post_flush(std::shared_ptr&&, spdlog::async_overflow_policy) spdlog::details::thread_pool::queue_size() spdlog::details::thread_pool::worker_loop_() spdlog::details::thread_pool::discard_counter() spdlog::details::thread_pool::overrun_counter() spdlog::details::thread_pool::post_async_msg_(spdlog::details::async_msg&&, spdlog::async_overflow_policy) spdlog::details::thread_pool::process_next_msg_() spdlog::details::thread_pool::reset_discard_counter() spdlog::details::thread_pool::reset_overrun_counter() spdlog::details::thread_pool::post_log(std::shared_ptr&&, spdlog::details::log_msg const&, spdlog::async_overflow_policy) spdlog::details::thread_pool::thread_pool(unsigned long, unsigned long) spdlog::details::thread_pool::thread_pool(unsigned long, unsigned long, std::function) spdlog::details::thread_pool::thread_pool(unsigned long, unsigned long, std::function, std::function) spdlog::details::thread_pool::thread_pool(unsigned long, unsigned long) spdlog::details::thread_pool::thread_pool(unsigned long, unsigned long, std::function) spdlog::details::thread_pool::thread_pool(unsigned long, unsigned long, std::function, std::function) spdlog::details::thread_pool::~thread_pool() spdlog::details::thread_pool::~thread_pool() spdlog::details::log_msg_buffer::update_string_views() spdlog::details::log_msg_buffer::operator=(spdlog::details::log_msg_buffer&&) spdlog::details::log_msg_buffer::operator=(spdlog::details::log_msg_buffer const&) spdlog::details::log_msg_buffer::log_msg_buffer(spdlog::details::log_msg_buffer&&) spdlog::details::log_msg_buffer::log_msg_buffer(spdlog::details::log_msg const&) spdlog::details::log_msg_buffer::log_msg_buffer(spdlog::details::log_msg_buffer const&) spdlog::details::log_msg_buffer::log_msg_buffer(spdlog::details::log_msg_buffer&&) spdlog::details::log_msg_buffer::log_msg_buffer(spdlog::details::log_msg const&) spdlog::details::log_msg_buffer::log_msg_buffer(spdlog::details::log_msg_buffer const&) spdlog::details::periodic_worker::~periodic_worker() spdlog::details::periodic_worker::~periodic_worker() spdlog::details::os::create_dir(std::__cxx11::basic_string, std::allocator > const&) spdlog::details::os::_thread_id() spdlog::details::os::in_terminal(_IO_FILE*) spdlog::details::os::path_exists(std::__cxx11::basic_string, std::allocator > const&) spdlog::details::os::filename_to_str(std::__cxx11::basic_string, std::allocator > const&) spdlog::details::os::remove_if_exists(std::__cxx11::basic_string, std::allocator > const&) spdlog::details::os::sleep_for_millis(unsigned int) spdlog::details::os::is_color_terminal() spdlog::details::os::utc_minutes_offset(tm const&) spdlog::details::os::now() spdlog::details::os::pid() spdlog::details::os::fsync(_IO_FILE*) spdlog::details::os::getenv[abi:cxx11](char const*) spdlog::details::os::gmtime(long const&) spdlog::details::os::gmtime() spdlog::details::os::remove(std::__cxx11::basic_string, std::allocator > const&) spdlog::details::os::rename(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&) spdlog::details::os::fopen_s(_IO_FILE**, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&) spdlog::details::os::dir_name(std::__cxx11::basic_string, std::allocator > const&) spdlog::details::os::filesize(_IO_FILE*) spdlog::details::os::localtime(long const&) spdlog::details::os::localtime() spdlog::details::os::thread_id() spdlog::details::log_msg::log_msg(fmt::v10::basic_string_view, spdlog::level::level_enum, fmt::v10::basic_string_view) spdlog::details::log_msg::log_msg(spdlog::source_loc, fmt::v10::basic_string_view, spdlog::level::level_enum, fmt::v10::basic_string_view) spdlog::details::log_msg::log_msg(std::chrono::time_point > >, spdlog::source_loc, fmt::v10::basic_string_view, spdlog::level::level_enum, fmt::v10::basic_string_view) spdlog::details::log_msg::log_msg(fmt::v10::basic_string_view, spdlog::level::level_enum, fmt::v10::basic_string_view) spdlog::details::log_msg::log_msg(spdlog::source_loc, fmt::v10::basic_string_view, spdlog::level::level_enum, fmt::v10::basic_string_view) spdlog::details::log_msg::log_msg(std::chrono::time_point > >, spdlog::source_loc, fmt::v10::basic_string_view, spdlog::level::level_enum, fmt::v10::basic_string_view) spdlog::details::registry::set_levels(std::unordered_map, std::allocator >, spdlog::level::level_enum, std::hash, std::allocator > >, std::equal_to, std::allocator > >, std::allocator, std::allocator > const, spdlog::level::level_enum> > >, spdlog::level::level_enum*) spdlog::details::registry::set_formatter(std::unique_ptr >) spdlog::details::registry::default_logger() spdlog::details::registry::get_default_raw() spdlog::details::registry::register_logger(std::shared_ptr) spdlog::details::registry::enable_backtrace(unsigned long) spdlog::details::registry::register_logger_(std::shared_ptr) spdlog::details::registry::throw_if_exists_(std::__cxx11::basic_string, std::allocator > const&) spdlog::details::registry::disable_backtrace() spdlog::details::registry::initialize_logger(std::shared_ptr) spdlog::details::registry::set_error_handler(std::function, std::allocator > const&)>) spdlog::details::registry::set_default_logger(std::shared_ptr) spdlog::details::registry::apply_logger_env_levels(std::shared_ptr) spdlog::details::registry::set_automatic_registration(bool) spdlog::details::registry::get(std::__cxx11::basic_string, std::allocator > const&) spdlog::details::registry::drop(std::__cxx11::basic_string, std::allocator > const&) spdlog::details::registry::get_tp() spdlog::details::registry::set_tp(std::shared_ptr) spdlog::details::registry::drop_all() spdlog::details::registry::flush_on(spdlog::level::level_enum) spdlog::details::registry::instance() spdlog::details::registry::shutdown() spdlog::details::registry::tp_mutex() spdlog::details::registry::apply_all(std::function)> const&) spdlog::details::registry::flush_all() spdlog::details::registry::set_level(spdlog::level::level_enum) spdlog::details::registry::registry() spdlog::details::registry::registry() spdlog::details::registry::~registry() spdlog::details::registry::~registry() spdlog::drop_all() spdlog::flush_on(spdlog::level::level_enum) spdlog::shutdown() spdlog::apply_all(std::function)> const&) spdlog::get_level() spdlog::set_level(spdlog::level::level_enum) spdlog::spdlog_ex::spdlog_ex(std::__cxx11::basic_string, std::allocator >) spdlog::spdlog_ex::spdlog_ex(std::__cxx11::basic_string, std::allocator > const&, int) spdlog::spdlog_ex::spdlog_ex(std::__cxx11::basic_string, std::allocator >) spdlog::spdlog_ex::spdlog_ex(std::__cxx11::basic_string, std::allocator > const&, int)from spdlog.
-fvisibility=hidden
option is intended to simplify the task of exporting only some public APIs from the library, and some public API symbols will still cause conflicts at link time.
Since linkers usually link with the first symbol found, libraries linked with different versions of spdlog will cause link errors at link time or undefined behavior at runtime.
Since your problem is caused by using different versions of spdlog, you should rebuild all your libraries using the same version of spdlog.
from spdlog.
Exactly. If default visibility is hidden. If default visibility is "default" and I use spdlog, all my *.so files exports spdlog's symbols.
from spdlog.
Even if supporting CMAKE_CXX_VISIBILITY_PRESET
, the symbols of the public API must be exposed.
It would not solve the problem of libraries using different versions of spdlog.
from spdlog.
Related Issues (20)
- spdlog install bundled fmt headers despite to -DSPDLOG_USE_STD_FORMAT=on HOT 4
- spdlog 1.14.1 fails to build with fmt 11.0.1 HOT 2
- Log rotation does not work if the log file has multiple owner processes
- i can't build it about Spalog, need help~ HOT 1
- compiler error on vs2015 HOT 5
- why the symbol of stopwatch not in libspdlog.dylib HOT 1
- ANSI color sink on Windows
- Resource deadlock would ocur HOT 6
- Undefined symbol error for spdlog::details::os::utf8_to_strbuf on Windows HOT 1
- build with SPDLOG_FMT_EXTERNAL_HO error HOT 2
- Windows linker warnings disabled HOT 1
- How do I log a std::iostream? HOT 2
- [MSVC 17.10.5] spdlog::sinks::base_sink<Mutex>::set_pattern() crash HOT 5
- Enums do not work. HOT 1
- Why customized logger can't print function name? HOT 3
- When initializing, it prompts "simple log instance" HOT 1
- spdlog does not print in python async function HOT 1
- error: call to non-‘constexpr’ function ‘long int sysconf(int)’ HOT 1
- I found that we can use python format style: HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spdlog.