Closed vagmi closed 7 years ago
The libnfc wrapper uses cgo to access the libnfc. By default, cgo is disabled for cross-compilations, leading to the error you observe. If you want to cross compile the nfc wrapper, you need to provide a C cross-compiler and a compiled copy of the libnfc and set CC_FOR_TARGET
as outlined in this document.
I recommend you to compile the libnfc and this wrapper on your Raspberry Pi instead of trying to cross-compile it.
I am trying to cross compile a simple go program.
I am cross compiling it with the following command.
I am using the
golang:1.7.5
docker image (based on debian wheezy) for compilation. I encounter the following compiler error.It is clear that
etc.go
hastype context struct
defined in the nfc package. This error occurs only during cross compilation. Is there something that I am missing?