View: 4481|Reply: 1

Orange Pi Zero WiringSerial Not Working

[Copy link]

2

threads

2

posts

26

credits

Novice

Rank: 1

credits
26
Published in 2017-11-29 16:47:01 | Show all floors |Read mode
Dear All,

I need to use WiringSerial Library on Orange Pi Zero. We will use a HC-05 module on UART port and get some data over Serial port and run someprogram in C according to values gotten from HC-05.

I installed the WiringOP-Zero and tried to compile WiringOP-Zero serialRead.c example and I got error when compiling

I compiled the code with this command : gcc -o SerialRead serialRead.c -l wiringPi

it gives me error as below

//usr/local/lib/libwiringPi.so : undefined reference to 'pthread_join'
//usr/local/lib/libwiringPi.so : undefined reference to 'pthread_create'

//usr/local/lib/libwiringPi.so : undefined reference to 'pthread_cancel'

collect2: error : ld returned 1 exit status

What can I do?

Thanks

1

threads

2

posts

61

credits

Registered member

Rank: 2

credits
61
Published in 2018-1-25 19:37:43 | Show all floors
add the -lpthread option:

gcc -o SerialRead serialRead.c -l wiringPi -lpthread
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list