Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get "duplicate symbol reference" when including two cgo based libraries?

I'm trying to build (go build) the following:

package main

import (
    "fmt"
    _ "github.com/d2g/unqlitego"
    _ "github.com/mattn/go-sqlite3"
)

func main() {
    fmt.Println("Erm Compile?")
}

and I get an error:

duplicate symbol reference: __moddi3 in both github.com/d2g/unqlitego( .text) and github.com/mattn/go-sqlite3(.text)

I'm running go version go1.3.1 windows/386.

Am I doing something wrong? How would you resolve this sort of issue?

Is this OS/Go Version/Architecture specific bug? (I'd appreciate "it works for me" with the output from your go version)

I've put this all in a repo so you should be able to just go get github.com/d2g/issue-duplicate_symbol.

As per comments looks like a Windows 386 issue logged on: https://code.google.com/p/go/issues/detail?id=8702

like image 341
DanG Avatar asked Sep 11 '14 08:09

DanG


1 Answers

@AndrewN notes that this is a Windows specific issue: see golang.org/issue/8756 or original issue at code.google.com/p/go/issues/detail?id=8756, won't be fixed until version 1.5.

(Documenting so this does not look like unanswered question).

like image 169
miltonb Avatar answered Sep 17 '22 11:09

miltonb