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

There seems to be a conflict when linking fmtlib in the same project using OpenAL #1105

Closed
ZehMatt opened this issue Feb 3, 2025 · 2 comments

Comments

@ZehMatt
Copy link

ZehMatt commented Feb 3, 2025

I've briefly looked into how OpenAL uses fmt and I've noticed that its just a copy and some edits such as the new namespace. It appears that not all the symbols are under this new namespace as I get following linker errors.

"void __cdecl fmt::v11::detail::assert_fail(char const *,int,char const *)" (?assert_fail@detail@v11@fmt@@YAXPBDH0@Z) already defined in Audio.obj
"void __cdecl fmt::v11::report_error(char const *)" (?report_error@v11@fmt@@YAXPBD@Z) already defined in Audio.obj
"void __cdecl fmt::v11::detail::vformat_to(class fmt::v11::detail::buffer<char> &,class fmt::v11::basic_string_view<char>,class fmt::v11::basic_format_args<class fmt::v11::context>,struct fmt::v11::detail::locale_ref)" (?vformat_to@detail@v11@fmt@@YAXAAV?$buffer@D@123@V?$basic_string_view@D@23@V?$basic_format_args@Vcontext@v11@fmt@@@23@Ulocale_ref@123@@Z) already defined in Audio.obj
"void __cdecl fmt::v11::detail::vprint_mojibake(struct _iobuf *,class fmt::v11::basic_string_view<char>,class fmt::v11::basic_format_args<class fmt::v11::context>,bool)" (?vprint_mojibake@detail@v11@fmt@@YAXPAU_iobuf@@V?$basic_string_view@D@23@V?$basic_format_args@Vcontext@v11@fmt@@@23@_N@Z) already defined in Diagnostics.lib(Logging.obj)
"void __cdecl fmt::v11::vprint(struct _iobuf *,class fmt::v11::basic_string_view<char>,class fmt::v11::basic_format_args<class fmt::v11::context>)" (?vprint@v11@fmt@@YAXPAU_iobuf@@V?$basic_string_view@D@12@V?$basic_format_args@Vcontext@v11@fmt@@@12@@Z) already defined in Diagnostics.lib(Logging.obj)
"void __cdecl fmt::v11::vprint_buffered(struct _iobuf *,class fmt::v11::basic_string_view<char>,class fmt::v11::basic_format_args<class fmt::v11::context>)" (?vprint_buffered@v11@fmt@@YAXPAU_iobuf@@V?$basic_string_view@D@12@V?$basic_format_args@Vcontext@v11@fmt@@@12@@Z) already defined in Diagnostics.lib(Logging.obj)
"bool __cdecl fmt::v11::detail::write_console(int,class fmt::v11::basic_string_view<char>)" (?write_console@detail@v11@fmt@@YA_NHV?$basic_string_view@D@23@@Z) already defined in Diagnostics.lib(Logging.obj)
"void __cdecl fmt::v11::detail::print(struct _iobuf *,class fmt::v11::basic_string_view<char>)" (?print@detail@v11@fmt@@YAXPAU_iobuf@@V?$basic_string_view@D@23@@Z) already defined in Diagnostics.lib(Logging.obj)
"public: __thiscall fmt::v11::detail::utf8_to_utf16::utf8_to_utf16(class fmt::v11::basic_string_view<char>)" (??0utf8_to_utf16@detail@v11@fmt@@QAE@V?$basic_string_view@D@23@@Z) already defined in Diagnostics.lib(Logging.obj)
"class fmt::v11::detail::uint128_fallback __cdecl fmt::v11::detail::dragonbox::get_cached_power(int)" (?get_cached_power@dragonbox@detail@v11@fmt@@YA?AVuint128_fallback@234@H@Z) already defined in Audio.obj
"bool __cdecl fmt::v11::detail::is_printable(unsigned int)" (?is_printable@detail@v11@fmt@@YA_NI@Z) already defined in Audio.obj
"bool __cdecl fmt::v11::detail::write_loc(class fmt::v11::basic_appender<char>,class fmt::v11::loc_value,struct fmt::v11::format_specs const &,struct fmt::v11::detail::locale_ref)" (?write_loc@detail@v11@fmt@@YA_NV?$basic_appender@D@23@Vloc_value@23@ABUformat_specs@23@Ulocale_ref@123@@Z) already defined in Audio.obj
"class std::system_error __cdecl fmt::v11::vsystem_error(int,class fmt::v11::basic_string_view<char>,class fmt::v11::basic_format_args<class fmt::v11::context>)" (?vsystem_error@v11@fmt@@YA?AVsystem_error@std@@HV?$basic_string_view@D@12@V?$basic_format_args@Vcontext@v11@fmt@@@12@@Z) already defined in Diagnostics.lib(Logging.obj)
"class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl fmt::v11::vformat(class fmt::v11::basic_string_view<char>,class fmt::v11::basic_format_args<class fmt::v11::context>)" (?vformat@v11@fmt@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$basic_string_view@D@12@V?$basic_format_args@Vcontext@v11@fmt@@@12@@Z) already defined in Audio.obj
"protected: virtual bool __thiscall fmt::v11::format_facet<class std::locale>::do_put(class fmt::v11::basic_appender<char>,class fmt::v11::loc_value,struct fmt::v11::format_specs const &)const " (?do_put@?$format_facet@Vlocale@std@@@v11@fmt@@MBE_NV?$basic_appender@D@23@Vloc_value@23@ABUformat_specs@23@@Z) already defined in Audio.obj
one or more multiply defined symbols found

This might be also the cause of #1100 for when the project has a different version.

@kcat
Copy link
Owner

kcat commented Feb 4, 2025

Make sure you're building and linking against the updated Git version. The symbols do seem to be using the new namespace here:

$ nm -C libopenal.so.1 | grep assert_fail
00000000000fe0a0 t fmt::v11_alsoft::detail::assert_fail(char const*, int, char const*)

There hasn't been another release with the fix yet since there hasn't been many other significant changes, so make sure your source copy is from commit 0f78bdc or newer.

@ZehMatt
Copy link
Author

ZehMatt commented Feb 4, 2025

Make sure you're building and linking against the updated Git version. The symbols do seem to be using the new namespace here:

$ nm -C libopenal.so.1 | grep assert_fail
00000000000fe0a0 t fmt::v11_alsoft::detail::assert_fail(char const*, int, char const*)

There hasn't been another release with the fix yet since there hasn't been many other significant changes, so make sure your source copy is from commit 0f78bdc or newer.

We are currently getting the library from vcpkg, so we would have to add a port overlay or wait for the new release. It is currently not a blocker as the develop branch still pins and older vcpkg version but I was tinkering around with migrating to SDL3 so I had to update vcpkg and ran into this.

But anyway thanks for letting me know, I'll try to use it as a submodule for the time being.

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

2 participants