Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cgo: "can't compile multiple files" #8802

gopherbot opened this issue Sep 24, 2014 · 3 comments


Copy link

commented Sep 24, 2014

by philbinj:

I have a very simple swig project folder consisting of one .h file, one .cc file, one
.swigcxx file, and one go file. I'm running go 1.3.1 on Mac.

$ go build hippo/native
gives me "can't compile multiple files"

Drilling down further gives me:
mkdir -p $WORK/hippo/native/_obj/
mkdir -p $WORK/hippo/native/_obj/exe/
cd /Users/jphilbin/code/hippo/src/hippo/native
clang++ -I . -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments
-fmessage-length=0 -fno-common -g -O2 -o $WORK/hippo/native/_obj/ -c
swig -version
cd $WORK
/usr/local/go/pkg/tool/darwin_amd64/6g -o ./hippo/native/_obj/_go_.6 -trimpath . -p
command-line-arguments -complete -D _$WORK ./swig_intsize.go
cd /Users/jphilbin/code/hippo/src/hippo/native
swig -go -intgosize 32 -module native -o $WORK/hippo/native/_obj/native_wrap.cxx -outdir
$WORK/hippo/native/_obj/ -c++ native.swigcxx
/usr/local/go/pkg/tool/darwin_amd64/6c -F -V -w -trimpath $WORK -I
$WORK/hippo/native/_obj/ -I /usr/local/go/pkg/darwin_amd64 -o
$WORK/hippo/native/_obj/native_gc.6 -D GOOS_darwin -D GOARCH_amd64
# hippo/native
can't compile multiple files

I'm pretty sure that the argument to -trimpath is part of the problem as when I manually
run 6c without that flag it compiles fine. Can attach the source files if needed.

This comment has been minimized.

Copy link

commented Sep 25, 2014

Comment 1:

Is there any chance that you are mixing multiple versions of Go?  Do you have the GOROOT
environment variable set?  (It's normally not needed.)  Are you sure that
/usr/local/go/pkg/tool/darwin_amd64/6c is from Go 1.3.1?

This comment has been minimized.

Copy link

commented Sep 25, 2014

Comment 2 by philbinj:

Hmm, I couldn't get a version out of 6c, but you're right, unsetting GOROOT has picked
up a different 6c which works! Sorry for the noise!

This comment has been minimized.

Copy link

commented Sep 25, 2014

Comment 3:

Status changed to Retracted.

@gopherbot gopherbot added the retracted label Sep 25, 2014

@golang golang locked and limited conversation to collaborators Jun 25, 2016

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
2 participants
You can’t perform that action at this time.