Open JohnTar22 opened 2 years ago
Thanks.
That's strange, it is working on my Raspberry PI "as it":
user@raspberrypi:~/uscan $ uname -a
Linux raspberrypi 5.10.17-v7l+ #1421 SMP Thu May 27 14:00:13 BST 2021 armv7l GNU/Linux
user@raspberrypi:~/uscan $ make
cc -lpthread -o uscan uscan.c dahua.c list.c json.c xml.c wsdiscovery.c ssdp.c
user@raspberrypi:~/uscan $ ls uscan
uscan
Which compiler/linker are you using? GCC tool chain?
when trying to build on raspberry pi running arm64 kernel i get this error:
cc -lpthread -o uscan uscan.c dahua.c list.c json.c xml.c wsdiscovery.c ssdp.c /usr/bin/ld: /tmp/ccHANzeh.o: in function
main': uscan.c:(.text+0xe4): undefined reference topthread_create' /usr/bin/ld: uscan.c:(.text+0xf0): undefined reference to
pthread_cancel' /usr/bin/ld: uscan.c:(.text+0x14c): undefined reference topthread_cancel' /usr/bin/ld: uscan.c:(.text+0x1a0): undefined reference to
pthread_cancel' /usr/bin/ld: /tmp/ccHANzeh.o: in functionmulticastListener': uscan.c:(.text+0x440): undefined reference to
pthread_create' collect2: error: ld returned 1 exit status make: *** [Makefile:5: uscan] Error 1 `it is fixed by adding "-pthread" to the Makefile on line 5 making it look like that:
`LDFLAGS=-lpthread LDDEBUG=-g -O0 -v -da -Q
uscan: uscan.c dahua.c list.c json.c xml.c wsdiscovery.c ssdp.c $(CC) $(LDFLAGS) -pthread -o $@ $^
.PHONY: debug debug: uscan_debug uscan_debug: uscan.c dahua.c list.c json.c xml.c wsdiscovery.c ssdp.c $(CC) $(LDFLAGS) $(LDDEBUG) -o $@ $^
.PHONY: clean clean: $(RM) uscan
.PHONY: clean_debug clean_debug: $(RM) r.alignments $(RM) r.asmcons $(RM) r.barriers $(RM) r.dfinish $(RM) r.dfinit $(RM) r.dwarf2 $(RM) r.expand $(RM) r.final $(RM) r.into_cfglayout $(RM) r.ira $(RM) r.jump $(RM) r.jump2 $(RM) r.mach $(RM) r.nothrow $(RM) r.outof_cfglayout $(RM) r.pro_and_epilogue $(RM) r.reginfo $(RM) r.reload $(RM) r.shorten $(RM) r.split1 $(RM) r.split5 $(RM) r.vregs `
John.