-
Notifications
You must be signed in to change notification settings - Fork 740
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
Trouble compiling using MQTT transport #2435
Comments
I see the same problem, I can't find any of the mqtt symbols in the static or dynamic libraries. Here's the procedure I have to reproduce the problem:
Result: mqtt symbols are not present in libprov_device_client.so I also tried removing the build as dynamic config switch and searching for the mqtt symbols in the libprov_device_client.a but they're also not present. I currently can't link any mqtt functionality, any suggestions? |
Prov_Device_MQTT_Protocol is in prov_transport_mqtt_client.c
You need to build prov_device_client with the cmake -Duse_mqtt:BOOL=ON option
|
@benjaesq the mqtt symbols will be in the prov_mqtt_transport library. libprov_device_client does not call directly into MQTT as it can also support AMQP and HTTP protocols (and websockets). This is done via a jump table called PROV_DEVICE_TRANSPORT_PROVIDER.
|
Hi @ericwol-msft, thanks for your response. Yes, the symbols are indeed in prov_mqtt_transport.a and I can successfully link to it statically but what I noticed is that the build_as_dynamic flag has no effect in the prov_mqtt_transport library, and a shared object is not produced. The other libraries I use from the SDK produce shared objects so I thought this could be a fix you could consider. |
@benjaesq Thanks, I understand now and will investigate. |
FYI I have the same problem as well, Development Machine, OS, Compiler (and Other Relevant Toolchain Info) Cross Compiled on Ubuntu 22.04 SDK Version (Please Give Commit SHA if Manually Compiling) LTS_07_2022_Ref02 Protocol MQTT |
Any news regarding this issue? Perhaps there is a temporary workaround? |
There is no current workaround. You would need to build your own .so for this. |
For anyone looking for a temporary solution adding
|
this workaround is a bit rough, I'm not doubting that it works for your case but it disregards the build_as_dynamic setting and I don't see how this will provide so versioning (might fail under some build systems or exec environments). |
Please review my PR #2505 and kindly let me know if this solution works. Thanks! |
Development Machine, OS, Compiler (and Other Relevant Toolchain Info)
Cross Compiled on Ubuntu 20.04 using GNU 9.4.0
SDK Version (Please Give Commit SHA if Manually Compiling)
lts_01_2023
Protocol
MQTT/HTTP
Describe the Bug
I'm having the same issue as this person here #1479. I didn't find a solution on his thread regarding the fix. His issue was with the Prov_device_HTTP_Protocol mine is the Prov_device_MQTT_Protocol
undefined reference to Prov_Device_MQTT_Protocol
From the same line of code:
PROV_DEVICE_TRANSPORT_PROVIDER_FUNCTION prov_transport = Prov_Device_MQTT_Protocol;
Headers included:
CMake file:
I also tried running a nm command on an old version of the SDK shared object and the latest version to see whether that particular function is included in both but it was included in the older version of the shared object and not the new.
Thanks in advance!
Update:
I noticed that when I set the Use_installed_dependencies flag in the cmake file, I get these build errors for azure-macro-utils-c. I think this issue I'm facing with Prov_Device_MQTT_Protocol could be related to this flag not being set before building all the SDK binaries, reason why that function(Prov_Device_MQTT_Protocol) is not found in the shared object.
The text was updated successfully, but these errors were encountered: