Skip to content

How do I include additional libs (e.g. libserialport) in the toolchain? #111

Answered by abhiTronix
toomanybrians asked this question in Q&A
Discussion options

You must be logged in to vote

export PATH=$(pwd)/cross-pi-gcc-10.3.0-64/bin:$PATH
export LD_LIBRARY_PATH=$(pwd)/cross-pi-gcc-10.3.0-64/lib:$LD_LIBRARY_PATH
ld -lcurses --verbose
ld -lserialport --verbose
aarch64-linux-gnu-gcc -O3 -Wall -I /usr/include -L /lib/x86_64-linux-gnu -L $(pwd)/cross-pi-gcc-10.3.0-64/lib -o my_app my_app.c -lcurses -lserialport

@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…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@toomanybrians
Comment options

@abhiTronix
Comment options

@abhiTronix
Comment options

@toomanybrians
Comment options

Answer selected by toomanybrians
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants