cgo-by-example icon indicating copy to clipboard operation
cgo-by-example copied to clipboard

compile error

Open kevinburke opened this issue 9 years ago • 3 comments

Running make, "go vet" fails, I commented this line out, and get the following results.

gofmt -e -s -w .
cc -g -fPIC -c -o lib/lib.o lib/lib.c
cc -g -fPIC -shared -o liblib.so lib/lib.o
cc -g -fPIC -c wrapper/wrapper.c
LD_LIBRARY_PATH=. go run main.go
f0()
f1(5)
f1(8)
f2(Go string)
fmt: return f2(Go string)
f31: s1={5}, s1Ret={10}
f32: s1={10}, s1Ret={10}
s2={0xc20800014c}, *s2.p=8, i=8
f4: s2={0xc20800014c}, *s2.p=16, i=8
f1(0)
f1(1)
f1(2)
LD_LIBRARY_PATH=. go run main2.go
# command-line-arguments
ld: library not found for -llib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/usr/local/Cellar/go/1.3.3/libexec/pkg/tool/darwin_amd64/6l: running clang failed: unsuccessful exit status 0x100
make: *** [all] Error 2

I'm running go version go1.3.3 darwin/amd64

kevinburke avatar Dec 04 '14 02:12 kevinburke

Reason for this: https://code.google.com/p/go/issues/detail?id=5428

AlekSi avatar Dec 04 '14 06:12 AlekSi

what's the workaround?

Kevin Burke phone: 925.271.7005 | twentymilliseconds.com

On Wed, Dec 3, 2014 at 10:43 PM, Alexey Palazhchenko < [email protected]> wrote:

Reason for this: https://code.google.com/p/go/issues/detail?id=5428

— Reply to this email directly or view it on GitHub https://github.com/AlekSi/cgo-by-example/issues/1#issuecomment-65544414.

kevinburke avatar Dec 04 '14 07:12 kevinburke

8d9a07861521a7cb194a4d7aee33ed6677de6b99

AlekSi avatar Dec 04 '14 07:12 AlekSi