valyala / gozstd

go wrapper for zstd
MIT License
420 stars 60 forks source link

Using a customized old version of c++ zstd... using this wrapper... issue #37

Open hiqsociety opened 3 years ago

hiqsociety commented 3 years ago

great work by the way.

i'm using a very old and customized version of zstd. how do i replace

i've compiled my own c++ zstd into /usr/local/lib but... error here:

is it possible for the c wrapper to use different library files separately to compile? how to do this?

otherwise, how do i replace the 3 functions below? coz they are in the newer zstd package

CGO_CFLAGS="-I/usr/local/include" CGO_LDFLAGS="-L/usr/local/lib -lboost_fiber -lboost_context -lstdc++ -lm -lz -lsnappy -llz4 -lzstd -lbz2 -ljemalloc -pthread -lm -lgomp -lrt -ldl -laio" go get -u github.com/[myownrepo]/frocks

# github.com/valyala/gozstd

/usr/bin/ld: $WORK/b049/_x003.o: in function `_cgo_e9b7c5fe0b6f_Cfunc_ZSTD_getFrameContentSize_wrapper':
gozstd.cgo2.c:(.text+0x29b): undefined reference to `ZSTD_getFrameContentSize'
/usr/bin/ld: $WORK/b049/_x005.o: in function `_cgo_e9b7c5fe0b6f_Cfunc_ZSTD_CCtx_refCDict_wrapper':
writer.cgo2.c:(.text+0x1b): undefined reference to `ZSTD_CCtx_refCDict'
/usr/bin/ld: $WORK/b049/_x005.o: in function `_cgo_e9b7c5fe0b6f_Cfunc_ZSTD_CCtx_setParameter_wrapper':
writer.cgo2.c:(.text+0x5d): undefined reference to `ZSTD_CCtx_setParameter'
collect2: error: ld returned 1 exit status
valyala commented 2 years ago

@hiqsociety , the missing functions - ZSTD_getFrameContentSize, ZSTD_CCtx_refCDict and ZSTD_CCtx_setParameter - are used by gozstd. You can either remove the code, which calls these functions from gozstd or to replace them with equivalent functions from your version of zstd.