Skip to content
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 undefine reference to `pthread_join@GLIBC_2.34' #102

Open
develop-RD opened this issue Mar 3, 2024 · 0 comments
Open

Comments

@develop-RD
Copy link

  1. I install wiringOP c git

https://github.com/orangepi-xunlong/wiringOP/tree/next

  1. Looked at the examples:
INCLUDE = -I/usr/local/include
LDFLAGS = -L/usr/local/lib
LDLIBS    = -lwiringPi -lwiringPiDev -lpthread -lm -lcrypt -lrt
  1. Download include and lib on host machine, set relevant parade in eclipse.

But when assembling I see the following errors:

arm-linux-gnueabihf-gcc -L"/root/project/test_gpio/lib" -L"/root/project/test_gpio/global_lib" -o "test_gpio" ./src/test_gpio.o    "/root/project/test_gpio/lib/libwiringPi.so" -lwiringPi -lwiringPiDev -lpthread -lm -lcrypt -lrt
/root/project/test_gpio/lib/libwiringPi.so: undefined reference to `pthread_join@GLIBC_2.34'
/root/project/test_gpio/lib/libwiringPi.so: undefined reference to `fcntl@GLIBC_2.28'
/root/project/test_gpio/lib/libwiringPi.so: undefined reference to `shm_open@GLIBC_2.34'
/root/project/test_gpio/lib/libwiringPi.so: undefined reference to `crypt@XCRYPT_2.0'
/root/project/test_gpio/lib/libwiringPi.so: undefined reference to `pow@GLIBC_2.29'
/root/project/test_gpio/lib/libwiringPi.so: undefined reference to `pthread_cancel@GLIBC_2.34'
/root/project/test_gpio/lib/libwiringPi.so: undefined reference to `pthread_create@GLIBC_2.34'
collect2: error: ld returned 1 exit status
  1. Later I found information about dynamic linking. I removed libwiringPi.so. Executed the command ln -s libwiringPi.so.2.52 libwiringPi.so Thus creating a new link, but it did not help

  2. The final console output looks like this:

Building file: ../src/gp_test.c
Invoking: Cross GCC Compiler
aarch64-linux-gnu-gcc -pthread -I"/home/user/project/blink_gpio/wiringOP/wiringPi" -O0 -g3 -c -fmessage-length=0 -MMD -MP -MF"src/gp_test.d" -MT"src/gp_test.o" -o "src/gp_test.o" "../src/gp_test.c"
Finished building: ../src/gp_test.c
  
Building target: gp_test

Invoking: Cross GCC Linker
aarch64-linux-gnu-gcc -L/home/user/project/lib -o "gp_test" ./src/gp_test.o    -lwiringPi -lwiringPiDev -lpthread -lm -lcrypt -lrt
/home/user/project/lib/libwiringPi.so: undefined reference to `pthread_join@GLIBC_2.34'
/home/user/project/lib/libwiringPi.so: undefined reference to `shm_open@GLIBC_2.34'
/home/user/project/lib/libwiringPi.so: undefined reference to `crypt@XCRYPT_2.0'
/home/user/project/lib/libwiringPi.so: undefined reference to `pow@GLIBC_2.29'
/home/user/project/lib/libwiringPi.so: undefined reference to `pthread_cancel@GLIBC_2.34'
/home/user/project/lib/libwiringPi.so: undefined reference to `pthread_create@GLIBC_2.34'
collect2: error: ld execution completed with return code 1
make: *** [makefile:43: gp_test] Ошибка 1
"make all" terminated with exit code 2. Build might be incomplete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant