OldBikerPete Posted October 8, 2017 Share Posted October 8, 2017 I'm using a fairly newly created Armbian_5.25_Orangepizero_Ubuntu_xenial_default_3.4.113 on my orange Pi Zero, trying to port a set of programs from Raspberry Pi where they work OK. I use a script to build: gcc -o myProgram myProgram.cpp -lwiringPi -llibpthread and my problem is that ld reports that it cannot find libpthread.so. find / -name libpthread.so -print reports that the library is located in /usr/lib/arm-Linux-gnueabihf/ and indeed it is. There is no ld.so.conf file in /etc. so how do I get my program to complete linkage? Peter. PS: I seem to have successfully got the OPi Zero Wifi interface to perform as an access point. I won't be able to confirm this until I can get a program running but a lot of people will be interested if I can confirm and then post my magic incantations! Link to comment Share on other sites More sharing options...
martinayotte Posted October 8, 2017 Share Posted October 8, 2017 You should have an /etc/ld.so.conf along with directory /etc/ld.so.conf.d/ ... Link to comment Share on other sites More sharing options...
OldBikerPete Posted October 9, 2017 Author Share Posted October 9, 2017 Correction. I do have ld.so.conf which consists on one line thus: include /etc/ld.so.conf.d/*.conf and in the referenced folder are two files: arm-Linux-gnueabihf.conf and libc.conf the first of these files consists of two lines thus: /lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf and it is in the second of these folders that libpthread.so resides, along with libpthread.a and others. I have tried copying the libraries to the folder in which my program source and the script to compile it resides, tried using the full path of the library, no success. I am also having another problem with the distro which may relate. 'apt upgrade' and 'apt-get upgrade' find that 'linux-libc-dev' can be upgraded but the upgrade fails with bad URL/404 errors. PS. I have confirmed that my setup of the WiFi access point does work completely and properly - excited! Link to comment Share on other sites More sharing options...
The_Loko Posted October 9, 2017 Share Posted October 9, 2017 You need to use -lpthread instead of -llibpthread. 1 Link to comment Share on other sites More sharing options...
martinayotte Posted October 9, 2017 Share Posted October 9, 2017 1 hour ago, The_Loko said: You need to use -lpthread instead of -llibpthread. Good catch ! I didn't saw that one, I'm quite sure this is the real issue ... 1 Link to comment Share on other sites More sharing options...
OldBikerPete Posted October 9, 2017 Author Share Posted October 9, 2017 Thank you, thank you. Now all good. Thank you also for fixing the upgrade problem. Link to comment Share on other sites More sharing options...
Recommended Posts