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

Cannot build with MQTTOnlyBSDSocket set to 0 [Windows build] #1

Closed
juhda opened this issue Jun 4, 2020 · 7 comments
Closed

Cannot build with MQTTOnlyBSDSocket set to 0 [Windows build] #1

juhda opened this issue Jun 4, 2020 · 7 comments

Comments

@juhda
Copy link

juhda commented Jun 4, 2020

Cannot build when setting the value of MQTTOnlyBSDSocket to 0 in lib/include/Network/Clients/MQTT.hpp because lib/src/Network/Clients/MQTTClient.cpp tries to include files that do not exist in the repository.

@X-Ryl669
Copy link
Owner

X-Ryl669 commented Jun 4, 2020

Yes that's true. Those files are part of a very large networking multi-protocol library that we use internally for our needs and it's not open source (yet ?).

You have to define MQTTOnlyBSDSocket to 1. If you need TLS, you'll need to download and use MbedTLS library in that case. For an example code, you have the related repository or the fully featured MQTTc client in this repository.

@X-Ryl669
Copy link
Owner

X-Ryl669 commented Jun 4, 2020

The code will build and work correctly with MQTTOnlyBSDSocket set to 1, I meant.

@juhda
Copy link
Author

juhda commented Jun 4, 2020

I understand. Thank you for the clarification.

We have a scenario when our application is compiled with Visual Studio, in which case BSD sockets are not available. That's why I started to look around in the code and tried to change the macro; I hoped it might help.
Is there any straightforward solution to build with Visual Studio?

@X-Ryl669
Copy link
Owner

X-Ryl669 commented Jun 8, 2020

Do you need SSL ?

Currently, I can easily add the missing Socket.hpp file but SSLSocket.hpp requires so much dependencies (mainly OpenSSL wrappers but also all crypto code that have nothing to do with this project).

I'm sorry I'm not using Windows anymore since many years. I know the Socket class is cross platform, but I don't know for SSLSocket status.

@juhda
Copy link
Author

juhda commented Jun 8, 2020

No need for SSL (currently).

@X-Ryl669
Copy link
Owner

Ok, should be committed now. Please try again. You'll have to run ccmake (or cmake -DCROSSPLATFORM_SOCKET=ON) to enable cross platform socket code before rebuilding.

There is no cross platform SSL code currently, and I don't intend to re-write one.

The cross platform socket code is not exported upon library installation right now as I'm using the code in the tests subfolder, so you'll probably need to copy the missing files around if you intend to embed this code on windows.

@juhda
Copy link
Author

juhda commented Jun 16, 2020

Looks good. Thank you very much!

@juhda juhda closed this as completed Jun 16, 2020
@X-Ryl669 X-Ryl669 changed the title Cannot build with MQTTOnlyBSDSocket set to 0 Cannot build with MQTTOnlyBSDSocket set to 0 [Windows build] Jun 16, 2020
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