当我运行命令时:

go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest

我得到一个错误:

C:\Program Files\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\aymen\AppData\Local\Temp\go-link-3004266855\000005.o: In function `_fingerprintVar':
C:/Users/aymen/go/pkg/mod/github.com/pganalyze/pg_query_go/v5@v5.1.0/parser/include/pg_query_fingerprint_defs.c:660: undefined reference to `__stack_chk_fail'  
C:\Users\aymen\AppData\Local\Temp\go-link-3004266855\000005.o: In function `_fingerprintJsonReturning':
C:/Users/aymen/go/pkg/mod/github.com/pganalyze/pg_query_go/v5@v5.1.0/parser/include/pg_query_fingerprint_defs.c:2547: undefined reference to `__stack_chk_fail' 
C:\Users\aymen\AppData\Local\Temp\go-link-3004266855\000005.o: In function `_fingerprintRTEPermissionInfo':
C:/Users/aymen/go/pkg/mod/github.com/pganalyze/pg_query_go/v5@v5.1.0/parser/include/pg_query_fingerprint_defs.c:5932: undefined reference to `__stack_chk_fail' 
C:\Users\aymen\AppData\Local\Temp\go-link-3004266855\000005.o: In function `_fingerprintNode':
C:\Users\aymen\go\pkg\mod\github.com\pganalyze\pg_query_go\v5@v5.1.0\parser/pg_query_fingerprint.c:310: undefined reference to `__stack_chk_fail'
C:\Users\aymen\AppData\Local\Temp\go-link-3004266855\000005.o: In function `_fingerprintTableFunc':
C:/Users/aymen/go/pkg/mod/github.com/pganalyze/pg_query_go/v5@v5.1.0/parser/include/pg_query_fingerprint_defs.c:505: undefined reference to `__stack_chk_fail'  
C:\Users\aymen\AppData\Local\Temp\go-link-3004266855\000005.o:C:/Users/aymen/go/pkg/mod/github.com/pganalyze/pg_query_go/v5@v5.1.0/parser/include/pg_query_fingerprint_defs.c:919: more undefined references to `__stack_chk_fail' follow
collect2.exe: error: ld returned 1 exit status
  • 我的go版本是go版本go1.22.1 windows/amd64

我试着改变道路,但没有得到任何结果.

推荐答案

看起来很有可能没有安装gcc(C++编译器),或者没有指定路径,或者版本太旧. 要开始,您可以try 以下操作:

  1. 安装新版本的gcc
  2. 将路径写入%PATH %
  3. 打开一个新的控制台并输入命令g++ --version以确保正确输入编译器的路径
  4. 再次try 安装sql

还有一个更简单的 Select ,你可以简单地从sqlc网站下载一个现成的二进制文件(https://downloads.sqlc.dev/),如果新版本由于某种原因没有启动,那么你可以使用旧版本,

Postgresql相关问答推荐

PostGresql :正则表达式 Select 其中只有一个正斜杠的行

即使存在 GIN 索引,整理默认的类似查询也无法执行

使用来自 docker 图像的 postgres 设置 Keycloak 21

至少 pgRouting 的某些部分可以与并行查询并行运行吗?

从单选插入到多个表

PostgreSQL:在timestamp::DATE 上创建索引

全文搜索(Postgres)与Elastic search

使用 RPostgreSQL 进行 UTF-8 / Unicode 文本编码

在 CentOS 上安装 psycopg2 时遇到问题

Postgres 图像未创建数据库

IntegrityError:postgres 从转储恢复后,所有具有 ForeignKey 的模型/字段的id列中的空值

PostgreSQL CASE 在函数中的使用

从 PostgreSQL 中的时间戳获取日期

从time without time zone和时区名称中获取time with time zone

在不存在的行上有select for update块

当成功有时会导致退出代码为 1 时,如何可靠地确定 pg_restore 是否成功?

仅在存在时重命名列

使用 RPostgreSQL 写入特定模式

学习 PL/pgSQL 的好资源?

postgres LISTEN/NOTIFY rails