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

Can't build paho.mqtt.c, how to solve it? #1059

Closed
jayjupdhig opened this issue Jan 28, 2021 · 9 comments
Closed

Can't build paho.mqtt.c, how to solve it? #1059

jayjupdhig opened this issue Jan 28, 2021 · 9 comments

Comments

@jayjupdhig
Copy link

jayjupdhig commented Jan 28, 2021

Hi there

1.) Why i can't find that page (https://github.com/eclipse/paho.mqtt.c) not on https://github.com/eclipse/ ? When i visit https://github.com/eclipse/ and use Ctrl-F to find "paho", only get the java version - which is, i.m.o, a lil bit confusing....(???)

2.) The compilation of paho.mqtt.c (https://github.com/eclipse/paho.mqtt.c.git) in version 1.3.8 works well.

2.1) Clone & checkout to a specific version:

eatmydata -- git clone https://github.com/eclipse/paho.mqtt.c.git;
  mv paho.mqtt.c PAHO_MQTT_C;
  cd PAHO_MQTT_C;
  eatmydata -- git config credential.helper store;
  eatmydata -- git checkout v1.3.8 > /dev/null 2>&1 ||:;
  eatmydata -- git pull > /dev/null 2>&1 ||:;
  eatmydata -- git config credential.helper store;

2.2) Then compile:

cd ~/deployment/Temp/PAHO_MQTT_C;

eatmydata -- cmake -Bbuild -H. -DPAHO_ENABLE_TESTING=OFF -DPAHO_HIGH_PERFORMANCE=ON;
eatmydata -- cmake --build build/ --target install;
eatmydata -- ldconfig;

Output:

+ cd /root/deployment/Temp/PAHO_MQTT_C
+ eatmydata -- cmake -Bbuild -H. -DPAHO_ENABLE_TESTING=OFF -DPAHO_HIGH_PERFORMANCE=ON
-- CMake version: 3.13.4
-- CMake system name: Linux
-- Timestamp is 2021-01-28T11:15:47Z
-- Configuring done
-- Generating done
-- Build files have been written to: /root/deployment/Temp/PAHO_MQTT_C/build
+ eatmydata -- cmake --build build/ --target install
[ 75%] Built target common_obj
Scanning dependencies of target paho-mqtt3c
[ 78%] Building C object src/CMakeFiles/paho-mqtt3c.dir/MQTTClient.c.o
[ 82%] Linking C shared library libpaho-mqtt3c.so
[ 82%] Built target paho-mqtt3c
Scanning dependencies of target paho-mqtt3a
[ 85%] Building C object src/CMakeFiles/paho-mqtt3a.dir/MQTTAsync.c.o
[ 89%] Linking C shared library libpaho-mqtt3a.so
[ 92%] Built target paho-mqtt3a
[ 96%] Linking C executable MQTTVersion
[100%] Built target MQTTVersion
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/samples/MQTTAsync_publish.c
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/samples/MQTTAsync_publish_time.c
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/samples/MQTTAsync_subscribe.c
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/samples/MQTTClient_publish.c
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/samples/MQTTClient_publish_async.c
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/samples/MQTTClient_subscribe.c
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/samples/paho_c_pub.c
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/samples/paho_c_sub.c
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/samples/paho_cs_pub.c
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/samples/paho_cs_sub.c
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/samples/pubsub_opts.c
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/CONTRIBUTING.md
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/epl-v20
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/edl-v10
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/README.md
-- Up-to-date: /usr/local/share/doc/Eclipse Paho C/notice.html
-- Installing: /usr/local/lib/libpaho-mqtt3c.so.1.3.8
-- Up-to-date: /usr/local/lib/libpaho-mqtt3c.so.1
-- Up-to-date: /usr/local/lib/libpaho-mqtt3c.so
-- Installing: /usr/local/lib/libpaho-mqtt3a.so.1.3.8
-- Up-to-date: /usr/local/lib/libpaho-mqtt3a.so.1
-- Up-to-date: /usr/local/lib/libpaho-mqtt3a.so
-- Installing: /usr/local/bin/MQTTVersion
-- Set runtime path of "/usr/local/bin/MQTTVersion" to ""
-- Up-to-date: /usr/local/include/MQTTAsync.h
-- Up-to-date: /usr/local/include/MQTTClient.h
-- Up-to-date: /usr/local/include/MQTTClientPersistence.h
-- Up-to-date: /usr/local/include/MQTTProperties.h
-- Up-to-date: /usr/local/include/MQTTReasonCodes.h
-- Up-to-date: /usr/local/include/MQTTSubscribeOpts.h
-- Up-to-date: /usr/local/include/MQTTExportDeclarations.h
-- Up-to-date: /usr/local/lib/cmake/eclipse-paho-mqtt-c/eclipse-paho-mqtt-cConfig.cmake
-- Installing: /usr/local/lib/cmake/eclipse-paho-mqtt-c/eclipse-paho-mqtt-cConfig-noconfig.cmake
-- Up-to-date: /usr/local/lib/cmake/eclipse-paho-mqtt-c/eclipse-paho-mqtt-cConfigVersion.cmake
+ eatmydata -- ldconfig

3.) BUT... when i try to compile paho.mqtt.cPP (https://github.com/eclipse/paho.mqtt.cpp.git) i have some a problem at the compile step.

3.1) Clone & checkout to "standard" (master branch or release - whatever. As long as it works):

  rm -rf paho.mqtt.cpp && rm -rf PAHO_MQTT_CPP;
  eatmydata -- git clone https://github.com/eclipse/paho.mqtt.cpp.git;
  mv paho.mqtt.cpp PAHO_MQTT_CPP;
  cd PAHO_MQTT_CPP;
  eatmydata -- git config credential.helper store;
  eatmydata -- git pull;
  eatmydata -- git config credential.helper store;

3.2) Then compile:

cd ~/deployment/Temp/PAHO_MQTT_CPP;

export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib;
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib;

eatmydata -- cmake -Bbuild -H. -DPAHO_BUILD_DOCUMENTATION=FALSE;
cmake --build build/ --target install;
ldconfig;

...ends with that error:

+ cd /root/deployment/Temp/PAHO_MQTT_CPP
+ export LIBRARY_PATH=:/usr/local/lib
+ LIBRARY_PATH=:/usr/local/lib
+ export LD_LIBRARY_PATH=:/usr/local/lib
+ LD_LIBRARY_PATH=:/usr/local/lib
+ eatmydata -- cmake -Bbuild -H. -DPAHO_BUILD_DOCUMENTATION=FALSE
CMake Error at /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find PahoMqttC (missing: PAHO_MQTT_C_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindPahoMqttC.cmake:33 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/CMakeLists.txt:26 (find_package)


-- Configuring incomplete, errors occurred!
See also "/root/deployment/Temp/PAHO_MQTT_CPP/build/CMakeFiles/CMakeOutput.log".

When i look on conan-io/conan-center-index#3760, they write that i just have to do some steps with the paho.mqtt.cpp file;

But, in fact, a paho.mqtt.cpp doesn't exist:

root@xxx-debian10:~/deployment/Temp# find ./PAHO_MQTT_CPP | grep paho.mqtt.cpp
root@xxx-debian10:~/deployment/Temp#

Thank you very very much for your feedbacks! :-)

@jumoog
Copy link
Contributor

jumoog commented Jan 28, 2021

well 1)

XMu5yDxQpM.mp4

@jayjupdhig
Copy link
Author

Oh...

Thank you very much - i was thinking it's my mistake, the eclipse foundation has MUCH MORE projects than the few ones on the project front page! ;-)

@jayjupdhig
Copy link
Author

@icraggs
Copy link
Contributor

icraggs commented Jan 28, 2021

So this is really about the C++ client build?

@icraggs
Copy link
Contributor

icraggs commented Jan 28, 2021

That is, you can build the C client, but not the C++ client.

@kosuodhmwa
Copy link

OK thx. (This is my personal account)

So how to build the C++ client? Does somebody know this?

thank you very much for your feedbacks.

@jayjupdhig
Copy link
Author

"That is, you can build the C client, but not the C++ client."

But why is there a C++ client if we can't compile - what's the sense of that? Does not make any sense i'm my opinion...? ;-)

@icraggs
Copy link
Contributor

icraggs commented Feb 1, 2021

Er, yes the C++ client can build. I didn't say that it couldn't, just that you apparently are finding it difficult. The C++ client repository is https://github.com/eclipse/paho.mqtt.cpp which you already cloned from. There are build instructions there.

@icraggs
Copy link
Contributor

icraggs commented Feb 18, 2021

I'm going to close this as it concerns the C++ client build (link above).

@icraggs icraggs closed this as completed Feb 18, 2021
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

4 participants