I've been working on a fork of github.com/szferi/gomdb, a binding for the
LMDB C library. The C code is committed to the package directory for
linking purposes.

One thing I've done on my fork is add a 'black box'
example https://github.com/bmatsuo/lmdb.exp/blob/master/example_test.go. As
things are currently the examples work fine and `go test` passes.

But, `go test` fails to compile when I change the example's import
statement from "github.com/bmatsuo/lmdb.exp" (the fully qualified import
path) to "." (a relative path to the same location).

# testmain
/var/tmp/go-link-GmzkQC/000002.o: In function `mdb_cursor_open':
/home/bryan/src/github.com/bmatsuo/lmdb.exp/mdb.c:6963: multiple definition
of `mdb_cursor_open'
first defined here
/var/tmp/go-link-GmzkQC/000002.o: In function `mdb_cursor_close':
/home/bryan/src/github.com/bmatsuo/lmdb.exp/mdb.c:7048: multiple definition
of `mdb_cursor_close'
first defined here

collect2: error: ld returned 1 exit status
/usr/local/go/pkg/tool/linux_amd64/6l: running gcc failed: unsuccessful
exit status 0x100
FAIL github.com/bmatsuo/lmdb.exp [build failed]

I tried to put together a more minimal example of the problem using .c and
.h files I wrote by hand but was unable to reproduce the errors. I can't
see any problems in lmdb.h or lmdb.c, but I am not an expert C programmer.

Is anyone able to provide insight into why changing the import path does
not work in this situation?


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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupgolang-nuts @
postedNov 13, '14 at 2:45a
activeNov 13, '14 at 2:45a

1 user in discussion

Bryan Matsuo: 1 post



site design / logo © 2022 Grokbase