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

lzmq should use C++ linker (or ZeroMQ should stop using exceptions) #71

Open
Elv13 opened this issue Sep 26, 2022 · 1 comment
Open

Comments

@Elv13
Copy link

Elv13 commented Sep 26, 2022

Hello, love this library. I just want to document a problem I had when packaging it for an embedded system with (very) limited storage space. Using the $CC to link lzmq.so is that it only works if libstdc++ is a shared library. If it's a static library, then -lstdc++ gets ignored by GCC and the throw and new symbols are not linked at all. For some dubious reasons, it actually still produce a binary, but it doesn't work (undefined symbols at runtime).

Please either add this to CMakeLists.txt:

set_target_properties(lzmq PROPERTIES LINKER_LANGUAGE CXX)

Maybe wrapped in an CMAKE_CXX_COMPILER_ID check if you want to preserve the ability to compile on system without a C++ compiler, but which a shared libstdc++ library.

Or stop using C++ exception (and that's better). Then it's really only C symbols and wont depend on libstdc++ at all. C++ exceptions are banned in a lot of projects for various reasons, this is one of them.

@moteus
Copy link
Member

moteus commented Dec 10, 2022

This library does not use any C++ exceptions.
May be you link with static Lua compiled with them ?

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