简体   繁体   English

错误在Windows上使用gcc进行构建

[英]Error go build using gcc on windows

I'm working on hyperledger fabric sdk client on my computer which is running on Windows 10 64 bits but my problem is general with Go. 我正在运行Windows 10 64位的计算机上使用Hyperledger Fabric sdk客户端,但是Go的问题很普遍。 In order to do the go build command on my .go file, I had to install gcc. 为了对我的.go文件执行go build命令,我必须安装gcc。 So I installed cygwin 64 bits for Windows. 因此,我为Windows安装了cygwin 64位。 In the bin repository, I had 3 differents .exe for gcc. 在bin存储库中,我有3个gcc不同的.exe。 I tried all of them : 我尝试了所有这些:

  • gcc.exe : I have an error because this .exe is for windows 32 bits and go is 64 bits gcc.exe :我出错了,因为此.exe适用于Windows 32位,而go是64位
  • x86_64-w64-mingw32-gcc.exe : I have an error, this .exe isn't able to find -lltdl x86_64-w64-mingw32-gcc.exe :我遇到错误,此.exe无法找到-lltdl
  • x86_64-pc-cygwin-gcc : This .exe isn't able to find -lmingwex and -lmingw32 x86_64-pc-cygwin-gcc :此.exe无法找到-lmingwex和-lmingw32

The solution proposed on some subject was to install TDM-GCC-64, but when I do that, I have an error : ltdl.h not found 在某个主题上提出的解决方案是安装TDM-GCC-64,但是当我这样做时,出现错误:找不到ltdl.h

So if anyone have any idea in order to solve this issue, it will be great ! 因此,如果有人有任何想法可以解决此问题,那就太好了! Thank you :) 谢谢 :)

PS : Sorry for my english PS:对不起,我的英语

You're jumping to conclusions without thinking. 您会不加思索地得出结论。 Windows X64 has full support for 32-bit .exe, but of course you must avoid trying to mix 32-bit and 64-bit applications. Windows X64完全支持32位.exe,但是您必须避免尝试混用32位和64位应用程序。 You will need to look up how to install libtool or libltdl (.dll and .h) corresponding to whichever gcc version you end up choosing. 您将需要查看如何安装与最终选择的gcc版本相对应的libtool或libltdl(.dll和.h)。 It's unclear on the cygwin web page whether that is supported for cygwin64. cygwin网页上尚不清楚cygwin64是否支持该功能。 Also, you may need to think about whether you want cygwin gcc and go or a mingw version. 另外,您可能需要考虑是否要使用cygwin gcc和go或mingw版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM