I've done some more test, and found that if I try to go build the package,
somehow it's gcc who is executed against the libtorrent_gc.c file, not 6c:
WORK=/tmp/go-build185137340
github.com/steeve/libtorrent-go
mkdir -p $WORK/github.com/steeve/libtorrent-go/_obj/
mkdir -p $WORK/github.com/steeve/
cd /Users/steeve/projects/go/src/github.com/steeve/libtorrent-go
CGO_LDFLAGS="-g" "-O2" /usr/local/go/pkg/tool/linux_amd64/cgo -objdir
$WORK/github.com/steeve/libtorrent-go/_obj/ -- -I
$WORK/github.com/steeve/libtorrent-go/_obj/ libtorrent.go
/usr/local/go/pkg/tool/linux_amd64/6c -F -V -w -trimpath $WORK -I
$WORK/github.com/steeve/libtorrent-go/_obj/ -I
/usr/local/go/pkg/linux_amd64 -o
$WORK/github.com/steeve/libtorrent-go/_obj/_cgo_defun.6 -D GOOS_linux -D
GOARCH_amd64 $WORK/github.com/steeve/libtorrent-go/_obj/_cgo_defun.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -print-libgcc-file-name
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -I
$WORK/github.com/steeve/libtorrent-go/_obj/ -g -O2 -o
$WORK/github.com/steeve/libtorrent-go/_obj/_cgo_main.o -c
$WORK/github.com/steeve/libtorrent-go/_obj/_cgo_main.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -I
$WORK/github.com/steeve/libtorrent-go/_obj/ -g -O2 -o
$WORK/github.com/steeve/libtorrent-go/_obj/_cgo_export.o -c
$WORK/github.com/steeve/libtorrent-go/_obj/_cgo_export.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -I
$WORK/github.com/steeve/libtorrent-go/_obj/ -g -O2 -o
$WORK/github.com/steeve/libtorrent-go/_obj/libtorrent.cgo2.o -c
$WORK/github.com/steeve/libtorrent-go/_obj/libtorrent.cgo2.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -I
$WORK/github.com/steeve/libtorrent-go/_obj/ -g -O2 -o
$WORK/github.com/steeve/libtorrent-go/_obj/libtorrent_gc.o -c
./libtorrent_gc.c
# github.com/steeve/libtorrent-go
./libtorrent_gc.c:34:21: fatal error: runtime.h: No such file or directory
compilation terminated.
On Wednesday, November 5, 2014 2:20:52 AM UTC+1, Steeve Morin wrote:Hi,
I'm trying to build my package
https://github.com/steeve/libtorrent-gousing SWIG.
I've built SWIG from source from today's master, and it runs okay.
However, when I try to build the generated package inside my go program, I
get this:
C source files not allowed when not using cgo: libtorrent_gc.c
Looking at the code in golang, I decide to add import "C" to
libtorrent_gc.c (why SWIG doesn't do it itself is an open question,
should it?).
Running the build again, it starts to build okay, but fails at:
../libtorrent-go/libtorrent_gc.c:34:10: fatal error: 'runtime.h' file not
found
If I remove the file, it builds okay, but the program fails to start
because the symbols are not set (this is what this file does)
Here is a quick preview of the file, just in case:
http://pastebin.com/dPVZZL5THere is the full output with -x -v:
http://pastebin.com/AL2fKWijHere is the full output when creating libtorrent-go:
http://pastebin.com/EzebdV4tAlso, as I understand it, 5c/6c/8c will be removed at some point. What is
the suggested way of moving forward for these cases?
Thank you!
--
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
[email protected].
For more options, visit
https://groups.google.com/d/optout.