[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