解决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配置

目录
相关文章
|
安全 Windows
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
206 1
|
2月前
|
物联网 虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 9 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 9 月更新)
1306 2
Windows 10 version 22H2 中文版、英文版下载 (2025 年 9 月更新)
|
6月前
|
存储 缓存 API
Windows 10 on ARM, version 22H2 ARM64 中文版、英文版下载 (2025 年 5 月更新)
Windows 10 on ARM, version 22H2 ARM64 中文版、英文版下载 (2025 年 5 月更新)
5961 1
Windows 10 on ARM, version 22H2 ARM64 中文版、英文版下载 (2025 年 5 月更新)
|
虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 6 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 6 月更新)
1545 0
|
9月前
|
物联网 虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 2 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 2 月更新)
362 4
Windows 10 version 22H2 中文版、英文版下载 (2025 年 2 月更新)
|
7月前
|
存储 监控 数据中心
Microsoft System Center 2025 version 2503 Multilanguage - Windows 服务器管理软件
Microsoft System Center 2025 version 2503 Multilanguage - Windows 服务器管理软件
230 0
|
8月前
|
物联网 虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 3 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 3 月更新)
405 4
|
网络协议 Go C语言
在golang中调试时的指令和使用技巧
【7月更文挑战第4天】 本文介绍 Go调试工具`dlv`常用命令概览及其使用技巧。
569 2
在golang中调试时的指令和使用技巧
|
编译器 Go C语言
通过例子学习在golang中调试程序
【7月更文挑战第4天】Go语言支持使用cgo进行汇编调试,官方文档在golang.org/doc/asm。注意,调试Go运行时可能遇到变量不可用或行号错误,需谨慎使用step命令。
244 1
通过例子学习在golang中调试程序

热门文章

最新文章

推荐镜像

更多