Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/cgo: SWIG + Go: unsupported relocation for dynamic symbol #10919
I'm trying to wrap a C++ library in Go using SWIG, but I'm getting build errors when I try to use the package since I upgraded to Go 1.4.2. SWIG Version 3.0.5.
The package can be found here: https://bitbucket.org/evanh/goewah
It contains the .swigcxx file as well as the C++ headers. For reference, I'm trying to interface with this library: https://github.com/lemire/EWAHBoolArray
Following the instructions on the SWIG website, I'm able to build my package and have it install on my machine. I couldn't figure out how to get Go to automatically read my .swigcxx file and build the package, so I had to add a Makefile that called all the commands manually.
However, the library builds and installs without errors. On Go 1.3.3, I could also use the package with no problems. However, running the same program in Go 1.4.2 causes a number of build errors.
My test program:
The errors I see when I try to go build it:
I figured this out. I had to link against the C library as well.