eclipse/paho.mqtt.c

Trace Output showing version 1.3.9 when 1.3.13 is installed

rywager opened this issue · 3 comments

Describe the bug
Trace Output showing version 1.3.9 when 1.3.13 is installed.

Trace: [3] =========================================================
Trace: [3] Trace Output
Trace: [3] Product name: Eclipse Paho Asynchronous MQTT C Client Library
Trace: [3] Version: 1.3.9
Trace: [3] Build level: 2021-05-24T18:53:54Z
Trace: [3] OpenSSL version: OpenSSL 1.1.1w 11 Sep 2023
Trace: [3] OpenSSL flags: compiler: arm-poky-linux-gnueabi-gcc -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Wdate-time --sysroot=recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map= -fdebug-prefix-map= -fdebug-prefix-map= -fdebug-prefix-map= -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_

From Dockerfile install
#8 47.70 ::::::::::::::
#8 47.70 ./version.major
#8 47.70 ::::::::::::::
#8 47.70 1::::::::::::::
#8 47.71 ./version.minor
#8 47.71 ::::::::::::::
#8 47.71 3::::::::::::::
#8 47.72 ./version.patch
#8 47.72 ::::::::::::::
#8 47.72 13

To Reproduce
wget https://github.com/eclipse/paho.mqtt.c/archive/refs/tags/v1.3.13.tar.gz &&
tar xvf v1.3.13.tar.gz &&
rm v1.3.13.tar.gz &&
cd paho.mqtt.c-1.3.13 &&
cmake -Bbuild -H. -DPAHO_WITH_SSL=ON -DPAHO_ENABLE_TESTING=OFF
-DCMAKE_INSTALL_PREFIX=/opt/axis/acapsdk/sysroots/armv7hf/usr &&
cmake --build build/ --target install &&
cd .. &&
rm -rf ./paho.mqtt.c-1.3.13

Initialize a client in C

See trace output above

Expected behavior

I would expect to see version 1.3.13 in the trace output.

Screenshots

image image

** Environment (please complete the following information):**
Linux axis-b8a44f278992 5.10.52-axis8 #1 PREEMPT Wed Nov 30 11:47:20 UTC 2022 armv7l GNU/Linux

You have an older version of the library somewhere on your system that is loaded first.

Try:

which libpaho-mqtt3as.so

to see all libpaho-mqtt3as.so in your system,

What @jumoog said is correct. If you have ldd available, you can use it to see exactly which one your app is linked against, like:

$ ldd async_consume | grep paho
	libpaho-mqttpp3.so.1 => /usr/local/lib/libpaho-mqttpp3.so.1 (0x00007fd4fdf88000)
	libpaho-mqtt3as.so.1 => /usr/local/lib/libpaho-mqtt3as.so.1 (0x00007fd4fdf52000)

(Here I see my async_consume app is linked to the Paho C and C++ libraries in /usr/local/lib).

For_ your setup, the cross-compile ldd may be arm-poky-linux-gnueabi-ldd

Seems to be the case, not sure how this was happening since i'm building from Docker and compiling but i added the flags to build static and now i'm getting the correct output.

Thank you both!

-DPAHO_BUILD_STATIC=ON -DPAHO_BUILD_SHARED=OFF \