For c++, your swig file needs to have a swigcxx extension for the go tool to run swig properly.
On Apr 12, 2017 4:42 PM, "larry104" <larg.weil...@gmail.com> wrote: I seems I need to manually run swig (swig -go -cgo -c++ -intgosize 64 mylib.i) - it does not seem that 'go build' picks up the .i or .swig file. Then I need to call 'go tool cgo mylib.go'. This creates an _obj directory with a bunch of files. After that I tried calling 'go build'. This errors out when my c++ code refers to some 3d party libs. How can I tell 'go build' additional flags for compiling and linking like -I and -L flags? On Tuesday, April 11, 2017 at 5:35:52 PM UTC-7, Ian Lance Taylor wrote: > On Tue, Apr 11, 2017 at 5:00 PM, larry104 <larg.w...@gmail.com> wrote: > > > > As it seems with go 1.5 there is no 6c compiler anymore - I had it all > > working with go 1.4 but now upgrading to 1.8.1 I'm lost. Does anyone > know a > > link to an example how the flow from c++ to an .so library which I can > > include as package in go (>1.5) works? > > If you build using the go tool, everything will continue to work. > > If you can't use the go tool to invoke SWIG, then with current Go you > need to invoke SWIG with the -cgo option to get an input file for Go's > cgo tool. And at that point, it will be much simpler to let the go > tool take over. > > 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. -- 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.