-
Notifications
You must be signed in to change notification settings - Fork 446
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
Cross compiling error: "Could NOT find PahoMqttC (missing: PAHO_MQTT_C_LIBRARIES PAHO_MQTT_C_INCLUDE_DIRS)" #412
Comments
I had similar problem and I was able to solve it by setting:
|
Interesting @rafalSFara did you set this using the command options when running cmake? Like: cmake -Bbuild -H. \
-DPAHO_BUILD_SHARED=FALSE \
-DPAHO_WITH_SSL=FALSE \
-DPAHO_BUILD_DOCUMENTATION=OFF \
-DPAHO_BUILD_SAMPLES=ON \
-DPAHO_BUILD_STATIC=ON \
-DCMAKE_PREFIX_PATH=$HOME/fibocom/openlinux/marthe_linux/lib/mqtt/PahoMqttC \
-DCMAKE_INSTALL_PREFIX=$HOME/fibocom/openlinux/marthe_linux/lib/mqtt/PahoMqttCPP \
-DCMAKE_TOOLCHAIN_FILE=$HOME/toolchain-arm-linux-gnueabi.cmake \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH I've try this way but still not working. |
Actually I've used it in the conan recipe, but your usage looks correct to me. |
I'm trying to isolate my problem, so now I'm tryng to install both in a separed folder, but still not working. I can install paho.mqtt.c but when I try to install the C++ library It fails on Cmake configuration. Following your tip, I tried: cmake -Bbuild -H. \
-DPAHO_BUILD_SHARED=FALSE \
-DPAHO_WITH_SSL=FALSE \
-DPAHO_BUILD_DOCUMENTATION=OFF \
-DPAHO_BUILD_SAMPLES=ON \
-DPAHO_BUILD_STATIC=ON \
-DCMAKE_TOOLCHAIN_FILE=$HOME/toolchain-arm-linux-gnueabi.cmake \
-DCMAKE_PREFIX_PATH=$HOME/projects/mqtt/lib \
-DCMAKE_INSTALL_PREFIX=$HOME/projects/mqtt/lib \
-DCMAKE_FIND_ROOT_PATH=$HOME/projects/mqtt/lib \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH But it still getting the same error. |
hello guy. I have same problem. How do you fix it ? |
@dovantuan02 Post the toolchain file that you're using and I will try to recreate the problem. |
I'm trying to cross compile the mqtt C++ lib to use in my embedded linux device ( An armv7l device), then I add as a submodule paho.mqtt.cpp and also paho.mqtt.c and inside my project I created a lib folder to be installed all my dependencies. Basicaly, I ran:
In my project root folder:
Then I configure, compile and install sucefully
paho.mqtt.c
inside mqtt/paho.mqtt.c running:The
toolchain-arm-linux-gnueabi.cmake
file that I'm using is this fileThen, looks like it configure, compiles and installed successfully.
The configuration:
Compilation and installation:
The installed folders:
Then in the paho.mqtt.cpp lib installation:
I got the followed output:
My output log:
CMakeOutput.log
I don't understand why this is getting an error, the path to paho C already has
been specified
Information about my system:
Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: