On Wed, Dec 19, 2018 at 2:55 PM Peter Kleiweg <pklei...@xs4all.nl> wrote: > > Ian Lance Taylor <i...@golang.org> schreef op 19 december 2018 23:27:13 CET: > > On Wed, Dec 19, 2018 at 2:15 PM Peter Kleiweg <pklei...@xs4all.nl> > > wrote: > > > > > > > I assume that the recompile fails because compiling the C code > > fails. > > > You should compile the C code yourself, producing a .syso file. You > > > should add that .syso file to your package directory. You should > > > remove the C code from your package directory--you can still put it > > in > > > a subdirectory, of course, for reference. Then a Go program can > > > import your package, compile the Go code as usual, and use the .syso > > > file for the C code. Hopefully that won't be any more painful than > > > the approach you are using today, although it is different. > > > > > > This is not an option. > > > > If you were able to use Go binary packages, then I don't understand > > why this is not an option. The Go binary package must have included > > compiled versions of the C code. > > They do not. They have Go code and C code. They are installed with go get. > Then I add a file to the package source code that marks it as binary > package. After any upgrade of Go or the package, I remove the binary marker, > and repeat the procedure.
How about this: Move the C files to a subdirectory. Write a script or Makefile that compiles the C files into a .syso file in the main package directory, using flags that you specify. Fetch the package using `go get -d`. Run the script with the appropriate flags to generate the .syso file. At that point `go build` should work. 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.