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

extern "C" missing from mosquitto_broker.h and mosquitto_plugin.h #1290

Closed
D-r-P-3-p-p-3-r opened this issue May 23, 2019 · 1 comment
Closed
Milestone

Comments

@D-r-P-3-p-p-3-r
Copy link

This makes it a little tricky to write an auth-plugin in C++.

You have to include the files like this

extern "C" {
#include <mosquitto_broker.h>
}

or C++ name mangeling is going to get in your way, e.g. like this

mosquitto[1076]: Error: Unable to load auth plugin "/foo/auth.so".
mosquitto[1076]: Load error: /foo/auth.so: undefined symbol: _Z25mosquitto_client_usernamePK9mosquitto

Most likely all "public" headers should provide extern "C" support - like mosquitto.h does.

ralight added a commit that referenced this issue May 23, 2019
mosquitto_broker.h and mosquitto_plugin.h

Thanks to Wolfgang Petroschka.

Closes #1290.
@ralight ralight added this to the 1.6.3 milestone May 23, 2019
@ralight
Copy link
Contributor

ralight commented May 23, 2019

Completely agree, thanks done now thanks very much.

@ralight ralight closed this as completed May 23, 2019
vankxr pushed a commit to vankxr/mosquitto that referenced this issue Aug 9, 2019
mosquitto_broker.h and mosquitto_plugin.h

Thanks to Wolfgang Petroschka.

Closes eclipse#1290.
@lock lock bot locked as resolved and limited conversation to collaborators Aug 21, 2019
ralight added a commit that referenced this issue Sep 18, 2019
mosquitto_broker.h and mosquitto_plugin.h

Thanks to Wolfgang Petroschka.

Closes #1290.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants