Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

Anyone developing this ? #23

Open
Dragao75 opened this issue Aug 11, 2016 · 2 comments
Open

Anyone developing this ? #23

Dragao75 opened this issue Aug 11, 2016 · 2 comments

Comments

@Dragao75
Copy link

I am running Ubuntu 16.04 and get a compile error.

make all
g++ -DRPI -c -o ../rc-switch/RCSwitch.o ../rc-switch/RCSwitch.cpp
g++ -DRPI -c -o send.o send.cpp
g++ -DRPI ../rc-switch/RCSwitch.o send.o -o send -lwiringPi
/usr/lib/gcc/arm-linux-gnueabihf/5/../../../../lib/libwiringPi.so: undefined reference to pthread_join' /usr/lib/gcc/arm-linux-gnueabihf/5/../../../../lib/libwiringPi.so: undefined reference topthread_create'
/usr/lib/gcc/arm-linux-gnueabihf/5/../../../../lib/libwiringPi.so: undefined reference to `pthread_cancel'
collect2: error: ld returned 1 exit status
Makefile:8: recipe for target 'send' failed
make: *** [send] Error 1

Anyone have a solution?
Regards,

@thjm
Copy link

thjm commented Aug 11, 2016

I guess you have to link with the pthreads library, so add '-lpthread' to the linker options in the Makefile. Haven't any Ubuntu here to check this

@Dragao75
Copy link
Author

I have added this to the Makefile (I have very little experience with compiling) and that seems to do the trick. Compilation works with only 1 warning. But all 3 programs are compiled.

RFSniffer.cpp: In function ‘int main(int, char**)’:
RFSniffer.cpp:50:63: warning: format ‘%i’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
printf("Received %i\n", mySwitch.getReceivedValue() );
^
Although the RFSniffer does not give me the result(s) I was expecting I am very please to be able to continue. (When I run the Sniffer and press any button on the remote It does not receive. But this may be related to the cheap china 433Mhz or a connection issue)

thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants