我在我的项目中包含了一个使用cgo的库,即使卸载了cygwin,在编译时也会出现此错误。
我先安装了cygwin,然后尝试进行编译。我读了另一篇有关cygwin无法与cgo一起使用的文章,因此我为Windows安装了MinGW-64。我得到了编译错误。然后我卸载cygwin,仍然遇到同样的问题
C:\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\ciczhang\AppData\Local\Temp\go-link-091280735\000004.o: In function `COVER_buildDictionary':
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/cover.c:678: undefined reference to `__getreent'
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/cover.c:678: undefined reference to `__getreent'
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/cover.c:710: undefined reference to `__getreent'
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/cover.c:710: undefined reference to `__getreent'
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/cover.c:714: undefined reference to `__getreent'
C:\Users\ciczhang\AppData\Local\Temp\go-link-091280735\000004.o:/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/cover.c:714: more undefined references to `__getreent' follow
C:\Users\ciczhang\AppData\Local\Temp\go-link-091280735\000006.o: In function `ss_mintrosort':
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/divsufsort.c:444: undefined reference to `__assert_func'
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/divsufsort.c:517: undefined reference to `__assert_func'
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/divsufsort.c:516: undefined reference to `__assert_func'
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/divsufsort.c:503: undefined reference to `__assert_func'
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/divsufsort.c:502: undefined reference to `__assert_func'
C:\Users\ciczhang\AppData\Local\Temp\go-link-091280735\000006.o:/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/divsufsort.c:499: more undefined references to `__assert_func' follow
C:\Users\ciczhang\AppData\Local\Temp\go-link-091280735\000009.o: In function `FASTCOVER_buildDictionary':
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/fastcover.c:395: undefined reference to `__getreent'
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/fastcover.c:395: undefined reference to `__getreent'
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/fastcover.c:434: undefined reference to `__getreent'
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/fastcover.c:434: undefined reference to `__getreent'
/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/fastcover.c:430: undefined reference to `__getreent'
C:\Users\ciczhang\AppData\Local\Temp\go-link-091280735\000009.o:/cygdrive/c/NextGenPO/GoWorkplace/src/bitbucket-eng-sjc1.cisco.com/bitbucket/nextg/lds-microservice/vendor/github.com/DataDog/zstd/fastcover.c:430: more undefined references to `__getreent' follow
collect2.exe: error: ld returned 1 exit status