Git Product home page Git Product logo

Comments (6)

fpagliughi avatar fpagliughi commented on August 18, 2024 1

Works great, thanks!

from paho.mqtt.cpp.

fpagliughi avatar fpagliughi commented on August 18, 2024 1

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.

fpagliughi avatar fpagliughi commented on August 18, 2024 1

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.

guilhermeferreira avatar guilhermeferreira commented on August 18, 2024

@fpagliughi check pull request #69.

from paho.mqtt.cpp.

guilhermeferreira avatar guilhermeferreira commented on August 18, 2024

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.

guilhermeferreira avatar guilhermeferreira commented on August 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.