Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码编译出错:building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format #4

Closed
xiaoyuit opened this issue Sep 3, 2021 · 3 comments

Comments

@xiaoyuit
Copy link

xiaoyuit commented Sep 3, 2021

请问这种情况要怎么处理?
具体信息如下:
go env:

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/user/Library/Caches/go-build"
GOENV="/Users/user/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/user/dev/gowork/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/user/dev/gowork"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/zn/8k62zr217nx8hnvqlqp9dcsr0000gn/T/go-build572964230=/tmp/go-build -gno-record-gcc-switches -fno-common"

错误信息:

ld: warning: ignoring file ../../pkg/WeWorkFinanceSDK/lib/libWeWorkFinanceSdk_C.so, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 )
Undefined symbols for architecture x86_64:
  "_DecryptData", referenced from:
      __cgo_e5e14bdd3014_Cfunc_DecryptData in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_DecryptData)
  "_DestroySdk", referenced from:
      __cgo_e5e14bdd3014_Cfunc_DestroySdk in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_DestroySdk)
  "_FreeMediaData", referenced from:
      __cgo_e5e14bdd3014_Cfunc_FreeMediaData in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_FreeMediaData)
  "_FreeSlice", referenced from:
      __cgo_e5e14bdd3014_Cfunc_FreeSlice in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_FreeSlice)
  "_GetChatData", referenced from:
      __cgo_e5e14bdd3014_Cfunc_GetChatData in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_GetChatData)
  "_GetContentFromSlice", referenced from:
      __cgo_e5e14bdd3014_Cfunc_GetContentFromSlice in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_GetContentFromSlice)
  "_GetData", referenced from:
      __cgo_e5e14bdd3014_Cfunc_GetData in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_GetDataLen, __cgo_e5e14bdd3014_Cfunc_GetData )
  "_GetDataLen", referenced from:
      __cgo_e5e14bdd3014_Cfunc_GetDataLen in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_GetDataLen)
  "_GetMediaData", referenced from:
      __cgo_e5e14bdd3014_Cfunc_GetMediaData in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_GetMediaData)
  "_GetOutIndexBuf", referenced from:
      __cgo_e5e14bdd3014_Cfunc_GetOutIndexBuf in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_GetOutIndexBuf)
  "_GetSliceLen", referenced from:
      __cgo_e5e14bdd3014_Cfunc_GetSliceLen in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_GetSliceLen)
  "_Init", referenced from:
      __cgo_e5e14bdd3014_Cfunc_Init in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_Init)
  "_IsMediaDataFinish", referenced from:
      __cgo_e5e14bdd3014_Cfunc_IsMediaDataFinish in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_IsMediaDataFinish)
  "_NewMediaData", referenced from:
      __cgo_e5e14bdd3014_Cfunc_NewMediaData in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_NewMediaData)
  "_NewSdk", referenced from:
      __cgo_e5e14bdd3014_Cfunc_NewSdk in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_NewSdk)
  "_NewSlice", referenced from:
      __cgo_e5e14bdd3014_Cfunc_NewSlice in _x002.o
     (maybe you meant: __cgo_e5e14bdd3014_Cfunc_NewSlice)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@NICEXAI
Copy link
Owner

NICEXAI commented Sep 5, 2021

抱歉,当前SDK暂时仅支持Linux平台,建议在Linux环境下进行开发以及调试。

@xiaoyuit
Copy link
Author

抱歉,当前SDK暂时仅支持Linux平台,建议在Linux环境下进行开发以及调试。

非常感谢回复!

@LAShZ LAShZ closed this as completed Sep 13, 2021
@LAShZ
Copy link
Collaborator

LAShZ commented Sep 13, 2021

Because of the dependency of this project is the SDK provided by WeWork based on Linux (./lib/libWeWorkFinanceSdk_C.so), it's only possible to use it on Linux. We are considering add windows support to this project, see #5 . However, because WeWork doesn't provide a usable SDK based on MacOS or Unix, it's rather hard to use it on MacOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants