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

Undefined references from iothub_client_properties.h when included in C++ source file #2540

Closed
D-r-P-3-p-p-3-r opened this issue Nov 8, 2023 · 3 comments
Assignees

Comments

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

I got messages from the linker like

undefined reference to `IoTHubClient_Properties_Serializer_CreateReported(IOTHUB_CLIENT_PROPERTY_REPORTED_TAG const*, unsigned int, char const*, unsigned char**, unsigned int*)

undefined reference to `IoTHubClient_Properties_Serializer_Destroy(unsigned char*)'

when including iothub_client_properties.h in a C++ source code file.

The problem is that iothub_client_properties.h does not contain an extern "C" specification like

#ifdef __cplusplus
extern "C"
{
#endif

// ...

#ifdef __cplusplus
}
#endif

Including the file via

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

works but is ugly like hell.

@github-actions github-actions bot added the IoTSDK label Nov 8, 2023
@CIPop CIPop added the bug label Nov 8, 2023
@CIPop
Copy link
Member

CIPop commented Nov 8, 2023

Thanks @D-r-P-3-p-p-3-r for your report.
Please feel free to submit a PR.

@ericwolz ericwolz self-assigned this Dec 7, 2023
@ericwolz
Copy link
Contributor

ericwolz commented Dec 7, 2023

#2548

@ericwolz
Copy link
Contributor

ericwolz commented Dec 7, 2023

resolved

@ericwolz ericwolz closed this as completed Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants