解决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 程序的?
363 0
|
Go Windows
Go 交叉编译 跨平台编译(windows系统跨平台编译)
Go 交叉编译 跨平台编译(windows系统跨平台编译)
372 0
|
安全 Windows
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
安装MyEclipse遇到错误提示 Failed to find a Main Class in “C:Windows\Temp\“时的解决方案
315 1
|
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
840 0
|
网络协议 Go C语言
在golang中调试时的指令和使用技巧
【7月更文挑战第4天】 本文介绍 Go调试工具`dlv`常用命令概览及其使用技巧。
989 2
在golang中调试时的指令和使用技巧
|
编译器 Go C语言
通过例子学习在golang中调试程序
【7月更文挑战第4天】Go语言支持使用cgo进行汇编调试,官方文档在golang.org/doc/asm。注意,调试Go运行时可能遇到变量不可用或行号错误,需谨慎使用step命令。
427 1
通过例子学习在golang中调试程序
|
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`被视为特殊的原始值。
405 1
|
Linux Go API
go创建web项目分别在windows和linux部署
go创建web项目分别在windows和linux部署
404 0
Qtdesigner报错:This application failed to stat could not find or load the Qt platform plugin “windows“
Qtdesigner报错:This application failed to stat could not find or load the Qt platform plugin “windows“
|
Unix Go
cannot find package “golang.org/x/sys/unix“
cannot find package “golang.org/x/sys/unix“
348 0

热门文章

最新文章

推荐镜像

更多