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

目录
相关文章
|
NoSQL 小程序 Cloud Native
你是使用什么工具调试 golang 程序的?
你是使用什么工具调试 golang 程序的?
347 0
|
安全 Windows
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
292 1
|
10月前
|
物联网 虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 9 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 9 月更新)
3008 2
Windows 10 version 22H2 中文版、英文版下载 (2025 年 9 月更新)
|
存储 缓存 API
Windows 10 on ARM, version 22H2 ARM64 中文版、英文版下载 (2025 年 5 月更新)
Windows 10 on ARM, version 22H2 ARM64 中文版、英文版下载 (2025 年 5 月更新)
15699 1
Windows 10 on ARM, version 22H2 ARM64 中文版、英文版下载 (2025 年 5 月更新)
|
虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 6 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 6 月更新)
7018 0
|
物联网 虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 2 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 2 月更新)
556 4
Windows 10 version 22H2 中文版、英文版下载 (2025 年 2 月更新)
|
物联网 虚拟化 Windows
Windows 10 version 22H2 中文版、英文版下载 (2025 年 3 月更新)
Windows 10 version 22H2 中文版、英文版下载 (2025 年 3 月更新)
1563 4
|
存储 监控 数据中心
Microsoft System Center 2025 version 2503 Multilanguage - Windows 服务器管理软件
Microsoft System Center 2025 version 2503 Multilanguage - Windows 服务器管理软件
475 0
|
网络协议 Go C语言
在golang中调试时的指令和使用技巧
【7月更文挑战第4天】 本文介绍 Go调试工具`dlv`常用命令概览及其使用技巧。
957 2
在golang中调试时的指令和使用技巧

推荐镜像

更多