-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
spdlog 1.14.0: undefined reference to `spdlog::get(char const*)' #3081
Comments
It is not intended. Please provide steps to reproduce. |
Hi @gabime, This is the actual project (Eclipse eCAL) that fails building. The long CMake Options mostly turn everything off while still building enough to trigger the issue. The commands target Ubuntu 22.04 but should work on other Ubuntu versions as well.
The error printed by this is:
Checking out spdlog 1.13.0 instead of 1.14.0 resolves the issue. |
This commit (5532231) adds overloads to |
This could be something in the project setup(e.g. linking to wrong spdlog version). Pleas provide minimal reproducible example. The steps you provided are time consuming and project specific. |
@tt4g: Thanks for pointing that out. As I see it, that header takes the C++ version of the library consumer into account and not the C++ version used for compiling spdlog. So consuming a C++14 compatible spdlog binary with a C++ 17 project will break. The proper solution I guess would for example be to I checked the build logs and found the following: spdlog is built with C++11
ecal_sys_client is built with C++17 (gcc 11 default)
Later it breaks when linking the binaries:
|
If I understand the issue correctly, any C++17 (or later) project that uses spdlog, which was compiled with C++11, will fail. This is indeed problematic and should be addressed in the next release of spdlog. |
C++ version is a tricky issue. The best workaround I can think of is to use the same C++ version in the project with build tools such as autotools and CMake. |
Thanks for pointing this out @tt4g , I wasn’t aware of this. But even so, I am thunking about reverting this commit if it causes a problem that didn’t exist before. |
@gabime Yes, that is the case. spdlog downgrades itself to C++11 by default, which also isn't the nicest behavior: Lines 31 to 34 in 238c9ff
We don't use @tt4g: at least on gcc and msvc it is quite common to use different cxx standards. As long as the API doesn't use unsupported features, there is no issue with linking a library that was built with a different cxx standard. |
@FlorianReimold In fact, I have never encountered the problem of C++ standard features being broken by different C++ versions. |
Please make a release that corrects this problem. |
Fixed in version 1.14.1 |
In general, you need to make sure that at both build and consumption time, the user sees the same features.
In CMake you can then do something like
|
Fixed compatibility issue between c++17 and c++11 (#3081). Fixed creating folders under windows when full path with drive letter is given (#3079). Added mdc sample. Note: mdc is not supported in async loggers. * v1.14.0 introduced in: https://git.openembedded.org/meta-openembedded/commit/?id=a40b1fa392d20ebb29e38374d0f7ce1494bb797f causes: undefined reference to `spdlog::get(char const*)' in various consumers, more details in: gabime/spdlog#3081 Signed-off-by: Martin Jansa <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Fixed compatibility issue between c++17 and c++11 (#3081). Fixed creating folders under windows when full path with drive letter is given (#3079). Added mdc sample. Note: mdc is not supported in async loggers. * v1.14.0 introduced in: https://git.openembedded.org/meta-openembedded/commit/?id=a40b1fa392d20ebb29e38374d0f7ce1494bb797f causes: undefined reference to `spdlog::get(char const*)' in various consumers, more details in: gabime/spdlog#3081 Signed-off-by: Martin Jansa <[email protected]> Signed-off-by: Khem Raj <[email protected]>
Hi,
We are using spdlog in Eclipse eCAL.
undefined reference to 'spdlog::get(char const*)'
Build fails with spdlog 1.14.0: error: undefined symbol: spdlog::get(char const*) eclipse-ecal/ecal#1577
Is this API break intended / known?
Kind Regards
Florian
The text was updated successfully, but these errors were encountered: