golang 使用Torrent 包 编译过程中失败

# github.com/anacrolix/go-libutp
utp_api.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
// vim:set ts=4 sw=4 ai:
^
cc1plus.exe: warning: unrecognized command line option "-Wno-unused-const-variable" [enabled by default]
# github.com/anacrolix/go-libutp
utp_callbacks.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
// vim:set ts=4 sw=4 ai:
^
cc1plus.exe: warning: unrecognized command line option "-Wno-unused-const-variable" [enabled by default]
# github.com/anacrolix/go-libutp
utp_hash.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
/*
^
cc1plus.exe: warning: unrecognized command line option "-Wno-unused-const-variable" [enabled by default]
# github.com/anacrolix/go-libutp
utp_internal.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
/*
^
cc1plus.exe: warning: unrecognized command line option "-Wno-unused-const-variable" [enabled by default]
# github.com/anacrolix/go-libutp
utp_packedsockaddr.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
// vim:set ts=4 sw=4 ai:
^
cc1plus.exe: warning: unrecognized command line option "-Wno-unused-const-variable" [enabled by default]
# github.com/anacrolix/go-libutp
utp_utils.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
/*
^
cc1plus.exe: warning: unrecognized command line option "-Wno-unused-const-variable" [enabled by default]
# crawshaw.io/sqlite
blocking_step.c: In function 'unlock_notify_cb':
blocking_step.c:42:2: error: 'for' loop initial declarations are only allowed in C99 mode
for(int i=0; i < nArg; i++) {
^
blocking_step.c:42:2: note: use option -std=c99 or -std=gnu99 to compile your code

报了这些错误 原因是 go env 里把CGO 打开了,不知道这个环境变量是干嘛的,但是关上后就没有这个问题了

posted @ 2023-01-31 14:16  Jack_Q  阅读(99)  评论(0)    收藏  举报