How do I include additional libs (e.g. libserialport) in the toolchain? #111
-
Hello! First, thank you for this awesome project and wonderful instructions. I am new to cross compiling, so hopefully this question is easy. I have an app I'm trying to compile for Raspberry Pi via GitHub actions using an Ubuntu runner. The complexity for me is our app needs However I get an error on linking that -lserialport is not found. (Actually we use curses too so I also get an error that -lcurses is not found.) If I add I assume I need to link against the arm versions, which I attempted to do by specifying that path as an Here is my workflow.yml file (well, the relevant portions), so you can see what I'm doing.
(The ld commands are just for debugging trying to figure out what's what in the logs) I'd appreciate any insight as to whether I'm taking the right approach here, or if there's anything else I need to understand. Thanks in advance for any help or guidance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@toomanybrians You cannot build files like this if you're cross-compiling for different target OS than Host OS. You need to download/rsync sysroot from the target OS, and then cross-compile the binaries (in your case |
Beta Was this translation helpful? Give feedback.
@toomanybrians You cannot build files like this if you're cross-compiling for different target OS than Host OS. You need to download/rsync sysroot from the target OS, and then cross-compile the binaries (in your case
libserialport
). See this hello project for reference: https://github.com/abhiTronix/raspberry-pi-cross-compilers/wiki/Cross-Compiler-CMake-Usage-Guide-wi…