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

Linker error while crosscompiling to linux/mips #1148

Open
taushkanov opened this issue Nov 19, 2024 · 2 comments
Open

Linker error while crosscompiling to linux/mips #1148

taushkanov opened this issue Nov 19, 2024 · 2 comments

Comments

@taushkanov
Copy link

Hello!
After several compilations of messagepack to linux/arm, linux/x64 and some others I turned to linux/mips platform with toolchain-mipsel_24kc_gcc-12.3.0_musl.
In my case Messagepack is included in shared library that's being used by application.

So while compiling application I'm getting error:

mipsel-openwrt-linux-musl/bin/ld: libnodesd.so: undefined reference to msgpack::v1::adaptor::object<decltype(nullptr), void>::operator()(msgpack::v2::object&, decltype(nullptr) const&) const

Digging with nm shows that mentioned symbol is really undefined in library:

nm -D --demangle ./libnodesd.so | grep "msgpack::v1::adaptor::object<decltype(nullptr), void>::operator()"
U msgpack::v1::adaptor::object<decltype(nullptr), void>::operator()(msgpack::v2::object&, decltype(nullptr) const&) const

Everything is fine when compiling with regular x64 gcc, linaro arm crosscompiler and others.

I would be very appreciated for any clues to resolve error.

@redboltz
Copy link
Contributor

I am no sure but some of implementation defined type would cause the issue, I guess.

You can write your own adaptor using the following way:
https://github.com/msgpack/msgpack-c/wiki/v2_0_cpp_adaptor#non-intrusive-approach

Perhaps writing your own adaptor for decltype(nullptr) std::nullptr_t? solve the issue.

NOTE: msgpack-c (C++) is a header-only library. The all translation unit should have the same version of msgpack-c, basically. But if msgpack-c code is in the user's library, you can only use the type that is instantiated in the library, I guess.

@taushkanov
Copy link
Author

Thank you for quick answer.

Sorry for may be newbie quiestions, but I don't understand the reason of that error while same app/user library successfully compiles with other compilers.

I'm using MessagePack 3.1.0, 3.3.0 and today tried 6.1.0 with identical behavior.

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