-
Notifications
You must be signed in to change notification settings - Fork 78
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
Linker error with base units for "numerical_value_in()" #566
Comments
Interesting, can you repro your specific case in the Compiler Explorer (https://godbolt.org)? |
I cannot, at least not with clang 17 or clang 16. I guess compiler explorer can't use Apple Clang. I put my code in a public github repo though, so if you want to see exactly what I did it's here: https://github.com/sa2thoms/mp-units-sandbox/blob/main/src/main.cpp |
I do not have access to Apple, so I can't check if there is no repro with other compilers. Apple Clang 15 is a poor compiler, and I hope a new one will be released soon with better support. |
Okay, maybe I can just blame it on Apple then. I can always use something else. For my real (work) applications though, we are using MSVC for debugging and testing purposes sometimes, so that may pose a barrier to using this library for now, if we can't build in MSVC. And of course we are compiling on Clang with localization disabled, so that needs to be solved. |
I made a simple test program to try out the library (I am using Apple Clang 15). I am consuming the library using plain Cmake. I found an interesting problem where I can use the "numerical_value_in()" function for any combination of units except for the base units. For example:
This is the specific linker error I see:
[build] "auto mp_units::detail::expr_divide<mp_units::derived_unit, mp_units::one, mp_units::detail::type_list_of_unit_less, mp_units::si::metre, mp_units::si::second>(mp_units::si::metre, mp_units::si::second)", referenced from:
[build] auto mp_units::operator/<mp_units::si::metre, mp_units::si::second>(mp_units::si::metre, mp_units::si::second) in main.cpp.o
[build] ld: symbol(s) not found for architecture arm64
[build] clang: error: linker command failed with exit code 1 (use -v to see invocation)
The text was updated successfully, but these errors were encountered: