[FAQ] VisualStudio, Source file requires different compiler version (current compiler is 0.6.1+cxxxxxx)


 

当使用的 Solidity 库文件中 pragma 指定的 版本 与本地编译器的使用版本不一致时,会出现这类提示。

 

解决方式是菜单栏 View -> Extensions -> Extension Settings -> Compile Using Remote Versio 编辑 settings.json

在其中加一行:"solidity.compileUsingRemoteVersion": "v0.5.0+commit.1d4f565a",

针对你合约文件中指定的 Solidity 版本,选择实际存在的编译器版本配置上去即可 https://github.com/ethereum/solc-bin/tree/gh-pages/bin

 

Ref:https://ethereum.stackexchange.com/questions/62914/solidity-version-error

Link:https://www.cnblogs.com/farwish/p/12556524.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM