libsql icon indicating copy to clipboard operation
libsql copied to clipboard

Error related to `libsql_experimental.a` when used with golang sqlite3 driver

Open sjunepark opened this issue 1 year ago • 5 comments

Hi,

I'm using golang and am using go-libsql.

When I import sqlite3 and libsql, both drivers, the error below occurs.

import (
	_ "github.com/libsql/go-libsql"
	_ "github.com/mattn/go-sqlite3"
)
/usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
duplicate symbol '_sqlite3_vsnprintf' in:
    /private/var/folders/16/lvgrynkd1n93dqjg140gs5wm0000gn/T/go-link-3924145887/000013.o
    /Users/sejunpark/go/pkg/mod/github.com/libsql/[email protected]/lib/darwin_arm64/libsql_experimental.a[102](sqlite3.o)
duplicate symbol '_sqlite3_column_count' in:
    /private/var/folders/16/lvgrynkd1n93dqjg140gs5wm0000gn/T/go-link-3924145887/000013.o
    /Users/sejunpark/go/pkg/mod/github.com/libsql/[email protected]/lib/darwin_arm64/libsql_experimental.a[102](sqlite3.o)
duplicate symbol '_sqlite3_vfs_find' in:
    /private/var/folders/16/lvgrynkd1n93dqjg140gs5wm0000gn/T/go-link-3924145887/000013.o
    /Users/sejunpark/go/pkg/mod/github.com/libsql/[email protected]/lib/darwin_arm64/libsql_experimental.a[102](sqlite3.o)

(omitted)

ld: 266 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I thought this was an error related to bindings/c/Makefile

@haaawk Can you help check this out if possible? Thanks again.

sjunepark avatar Feb 14 '24 11:02 sjunepark

Thanks for reporting this issue @sjunepark. Do you have any suggestions on how to change the Makefile to fix the issue?

haaawk avatar Feb 14 '24 14:02 haaawk

@haaawk Wish I could help but I have no idea on what's going on😔

sjunepark avatar Feb 14 '24 14:02 sjunepark

Plus one on this, I've tried working on multiple golang migration libraries and they all have link issues.

ainsleyclark avatar Sep 07 '24 16:09 ainsleyclark