On Sat, Jul 22, 2017 at 4:41 AM, Sander van Harmelen <san...@xanzy.io> wrote: > Thanks Ian! And sorry for my late response… Didn’t find time the last few > days to test this. I use a different toolchain () and now I seem to get past > this problem :) > > But now I end up getting these errors: > > <SNIP> > /var/folders/2k/hxm__dq91bj19r7scpr3mzq80000gn/T/go-build613045906/github.com/google/gousb/_obj/libusb.cgo2.o: > In function `_cgo_403ec9e57611_Cfunc_libusb_set_interface_alt_setting': > libusb.cgo2.c:(.text+0x15bc): undefined reference to > `libusb_set_interface_alt_setting' > /var/folders/2k/hxm__dq91bj19r7scpr3mzq80000gn/T/go-build613045906/github.com/google/gousb/_obj/libusb.cgo2.o: > In function `_cgo_403ec9e57611_Cfunc_libusb_unref_device': > libusb.cgo2.c:(.text+0x16f0): undefined reference to `libusb_unref_device' > /var/folders/2k/hxm__dq91bj19r7scpr3mzq80000gn/T/go-build613045906/github.com/google/gousb/_obj/transfer.o: > In function `submit': > transfer.c:(.text+0x40): undefined reference to `libusb_submit_transfer' > collect2: error: ld returned 1 exit status > > I updated to build command to also include the libusb source: GOOS=linux > GOARCH=mipsle CGO_ENABLED=1 CC=mipsel-openwrt-linux-uclibc-gcc-4.8.3 > CGO_CFLAGS="-I ./include -I ./libusb-1.0.21/libusb" go build > > So it seems it doesn’t cross compile libusb first and so is missing those > symbols? Guessing a bit here… Any pointers on how to solve this?
Something like CGO_LDFLAGS="-lusb", with perhaps a -L option to the directory where the library exists. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.