Comments (6)
Works great, thanks!
from paho.mqtt.cpp.
Actually, the library builds but the samples don't.
Do you need to also do something similar for the samples?
I got this:
$ cmake -DPAHO_BUILD_SAMPLES=TRUE -DPAHO_MQTT_C_PATH=../../paho.mqtt.c ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/fmp/mqtt/paho.mqtt.cpp.git/build
$ make
Scanning dependencies of target common_obj
[ 5%] Building CXX object src/CMakeFiles/common_obj.dir/async_client.cpp.o
[ 11%] Building CXX object src/CMakeFiles/common_obj.dir/client.cpp.o
[ 17%] Building CXX object src/CMakeFiles/common_obj.dir/disconnect_options.cpp.o
[ 23%] Building CXX object src/CMakeFiles/common_obj.dir/iclient_persistence.cpp.o
[ 29%] Building CXX object src/CMakeFiles/common_obj.dir/message.cpp.o
[ 35%] Building CXX object src/CMakeFiles/common_obj.dir/response_options.cpp.o
[ 41%] Building CXX object src/CMakeFiles/common_obj.dir/token.cpp.o
[ 47%] Building CXX object src/CMakeFiles/common_obj.dir/topic.cpp.o
[ 52%] Building CXX object src/CMakeFiles/common_obj.dir/connect_options.cpp.o
[ 58%] Building CXX object src/CMakeFiles/common_obj.dir/will_options.cpp.o
[ 58%] Built target common_obj
Scanning dependencies of target paho-mqttpp3
[ 64%] Linking CXX shared library libpaho-mqttpp3.so
[ 64%] Built target paho-mqttpp3
Scanning dependencies of target sync_publish
[ 70%] Building CXX object src/samples/CMakeFiles/sync_publish.dir/sync_publish.cpp.o
In file included from /home/fmp/mqtt/paho.mqtt.cpp.git/src/mqtt/client.h:27:0,
from /home/fmp/mqtt/paho.mqtt.cpp.git/src/samples/sync_publish.cpp:27:
/home/fmp/mqtt/paho.mqtt.cpp.git/src/mqtt/async_client.h:27:23: fatal error: MQTTAsync.h: No such file or directory
compilation terminated.
src/samples/CMakeFiles/sync_publish.dir/build.make:62: recipe for target 'src/samples/CMakeFiles/sync_publish.dir/sync_publish.cpp.o' failed
make[2]: *** [src/samples/CMakeFiles/sync_publish.dir/sync_publish.cpp.o] Error 1
CMakeFiles/Makefile2:201: recipe for target 'src/samples/CMakeFiles/sync_publish.dir/all' failed
make[1]: *** [src/samples/CMakeFiles/sync_publish.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
from paho.mqtt.cpp.
I don't think that we need to be so worried about conditionally compiling SSL features. The Paho C library needs to turn it off so that it can compile on a system lacking the OpenSSL library.
But the C++ library, with SSL, just manages a few strings in the ssl_options
class, so it's not a huge burden to support it. If linked against a C library that doesn't support SSL, we're just told that the "ssh://..." connection type is unknown.
I'm a little more worried about someone compiling out SSL support from the C++ library, and then running it with a C library that does support SSL. In that case, are we properly initializing the connect options?
With that worry in mind I removed a few of the conditional compilation #if's from the code, for now. But in the long run it's OK to have that support as long as we know that it works with each combination of support - or lack there of - in both libraries.
from paho.mqtt.cpp.
@fpagliughi check pull request #69.
from paho.mqtt.cpp.
Yes @fpagliughi, I missed the samples' CMakeLists.txt. My fault.
get_filename_component(PAHO_MQTT_C_INC_DIR ${PAHO_MQTT_C_PATH}/include ABSOLUTE)
get_filename_component(PAHO_MQTT_C_LIB_DIR ${PAHO_MQTT_C_LIB} DIRECTORY)
I guess we can reuse the same variables available in the src/CMakeLists.txt. I'll try that.
from paho.mqtt.cpp.
@fpagliughi please check the solution in pull request #72.
Also, there is a problem with the SSL conditional compilation. I'll provide a solution for this in the next few hours.
from paho.mqtt.cpp.
Related Issues (20)
- No consumer notification when broker cleanly disconnects HOT 3
- paho.mqtt.cpp looks for PahoMqttC, but the package named - eclipse-paho-mqtt-c. HOT 2
- CMake Error when PAHO_BUILD_SAMPLES=TRUE (Cannot find src/samples/async_consume_v5.cpp) HOT 1
- Why is this project under Eclipse v1.0 when paho.mqtt.c is under Eclipse v2.0? HOT 1
- Building paho.mqtt.cpp: cmake doesn't pick up my c++ compiler correctly. HOT 4
- Homebrew Installation HOT 1
- Automatic Reconnect Crashes MQTT when `client.reconnect()` is called HOT 7
- Connect failed, more to try HOT 1
- SSL_read() Segmentation fault
- Build with PAHO_WITH_MQTT_C is broken HOT 3
- broker(emqx) already support QUIC, and i Hope client also supports the Quic protocol HOT 1
- arm cross get error HOT 5
- Add getter for the connect_options object (connOpts_) in async_client
- Operation not permitted on try_consume_message async HOT 1
- Base64TestOpenSSL giving problem and how to use only paho-mqtt3as libraray project in visual studio HOT 1
- Cross compilation of paho.mqtt.cpp HOT 9
- cmake issue in Docker container HOT 2
- error in install_paho_mqtt_c.sh in the installation process of the latest version of paho.mqtt.cpp HOT 1
- ThreadSanitizer: lock-order-inversion (potential deadlock) paho 1.2.0
- Linker-Error when compiling with v1.3.2 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paho.mqtt.cpp.