解决golang windows调试问题:Could not determine version number: could not find symbol value for runtime.buildVersion

简介: 版本信息:go:1.8.3windows: win7/64idea-go-plugin:171.4694.61在windows下,使用dlv进行调试的时候,如果golang程序引入了c模块,比如常用的sqlite模块,那么在调试的时候一定会发生这个错误:· Could not determine version number: could not find symbol value for runtime.buildVersion·现在这个问题已经解决了,解决方法就是go build 的时候加入-ldflags="-linkmode internal" ,这样就可以正常调试了。

版本信息:
go:1.8.3
windows: win7/64
idea-go-plugin:171.4694.61

在windows下,使用dlv进行调试的时候,如果golang程序引入了c模块,比如常用的sqlite模块,那么在调试的时候一定会发生这个错误:
· Could not determine version number: could not find symbol value for runtime.buildVersion·

现在这个问题已经解决了,解决方法就是go build 的时候加入-ldflags="-linkmode internal" ,这样就可以正常调试了。
如果用的是gogland ide,或者jetbrains其他ide,安装了golang插件,那么在Run/Debug Configurations时,可以在Go Tool arguments中加入
·-ldflags="-linkmode internal"·

具体见下图:
gogland配置

目录
相关文章
|
Go Windows
Go 交叉编译 跨平台编译(windows系统跨平台编译)
Go 交叉编译 跨平台编译(windows系统跨平台编译)
177 0
|
安全 Windows
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
184 1
|
12天前
|
物联网 虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 9 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 9 月更新)
698 2
Windows 10 version 22H2 中文版、英文版下载 (2025 年 9 月更新)
|
5月前
|
存储 缓存 API
Windows 10 on ARM, version 22H2 ARM64 中文版、英文版下载 (2025 年 5 月更新)
Windows 10 on ARM, version 22H2 ARM64 中文版、英文版下载 (2025 年 5 月更新)
4142 1
Windows 10 on ARM, version 22H2 ARM64 中文版、英文版下载 (2025 年 5 月更新)
|
虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 6 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 6 月更新)
1072 0
|
6月前
|
存储 监控 数据中心
Microsoft System Center 2025 version 2503 Multilanguage - Windows 服务器管理软件
Microsoft System Center 2025 version 2503 Multilanguage - Windows 服务器管理软件
129 0
|
8月前
|
物联网 虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 2 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 2 月更新)
319 4
Windows 10 version 22H2 中文版、英文版下载 (2025 年 2 月更新)
|
7月前
|
物联网 虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 3 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 3 月更新)
322 4
|
JavaScript Windows
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 1x.x
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 1x.x
414 0
|
JavaScript 前端开发 索引
JavaScript有7个数据类型:Number, String, Boolean, Null, Undefined, Symbol(BES6)和BigInt(ES10)组成基本类型
【6月更文挑战第25天】JavaScript有7个数据类型:Number, String, Boolean, Null, Undefined, Symbol(BES6)和BigInt(ES10)组成基本类型,而Object包括Array、Function等是引用类型。Objects可以包含键值对,Array是特殊的Object。Functions也是对象。`null`和`undefined`被视为特殊的原始值。
184 1

推荐镜像

更多