-
Notifications
You must be signed in to change notification settings - Fork 439
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 compilation of paho.mqtt.cpp #478
Comments
well, I would have liked to receive some help from the community but nobody answered :'( , anyway thanks to hard work and the support of my colleagues I was able to solve by myself, if you need help feel free to contact me |
I'm having the same issue. How did you get it to work? |
I do not know at which step are you but basically what you have to do is to separately cross-compile the c library, and you should have no problems in this step (I have done it statically, but probably it may works also dinamically), with PAHO_WITH_SSL set to FALSE otherwise you will have to cross-compile also the OpenSSL library (but it can be challenging), then you will have to manually move (I suggest to create an archive) the files related with this library so the .a files (.so if you built dinamically) and the includes of the library (that are usualy located in /usr/lib and /usr/include) into the directory of your cross compiler (in my case /usr/aarch64-linux-gnu/lib and /usr/aarch64-linux-gnu/include) then if you correctly set the path of library and headers in your toolchain file with SET(CMAKE_FIND_ROOT_PATH ...) you should be able to cross compile also the cpp library. |
For the Open SSL build I was targeting an older OS(bullseye armhf) which openSSL and crypto were included via Just in c library I had changed:
TO
Otherwise I would have to do what you suggest and compile OpenSSL on the device first. @Blackessst if you are having the same issue as @andreamanera then just pull down the repo from the pull request and use that. I forked this lib mid December so I wouldn't have to worry about tracking this issue and suggest you do the same and check back every now and then hope that the guys doing the C library are able to review and put through the needed changes :D |
As for release 1.3.2 I helped myself with a small patch, effectively reverting or enhancing f90f306. I need a static
Here's the patch:
|
Yes apologies. I started fixing a number of build issues last year, and thought it would be easier to push some fixes into the Paho C lib first. But those haven't landed yet, so I'm just going to proceed with a v1.4 release based on the existing C lib. The fixes for this issue are in line with what @hmb mentioned. The solution currently up in master requires the C lib to be built with the same static/shared options as you want to build the C++ library. So shared links to shared; static links to static. A build configuration error occurs if they are not matched. I worry that might me more complaints than it solves, but at least it would work consistently across platforms. And having the auto/submodule build of the C lib working properly using the |
I'm hoping this is fixed with the new code for the v1.4 release. If not, feel free to re-open this ticket. |
Hello,
I am developing a project for which I need to cross compile the paho mqtt cpp library on build platform x86_64 to host platform aarch64, first of all I cross compiled the paho mqtt c library and I think that I was able to do it properly, I didn't received any error and checking the files were effectively compiled for ARM aarch64, but when it comes to build the cpp library trying different times I've faced different errors. Now I would like to know if someone was able to achieve my goal and if so if you can provide a guide on how to do it.
Thank you for the support
The text was updated successfully, but these errors were encountered: