Error go build using gcc on windows - 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.
In order to do the go build command on my .go file, I had to install gcc. So I installed cygwin 64 bits for Windows.
In the bin repository, I had 3 differents .exe for gcc. I tried all of them :
gcc.exe : I have an error because this .exe is for windows 32 bits and go is 64 bits
x86_64-w64-mingw32-gcc.exe : I have an error, this .exe isn't able to find -lltdl
x86_64-pc-cygwin-gcc : This .exe isn't able to find -lmingwex and -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
So if anyone have any idea in order to solve this issue, it will be great !
Thank you :)
PS : Sorry for my english

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. You will need to look up how to install libtool or libltdl (.dll and .h) corresponding to whichever gcc version you end up choosing. It's unclear on the cygwin web page whether that is supported for cygwin64. Also, you may need to think about whether you want cygwin gcc and go or a mingw version.

Related

How to set up Codeblocks to work with mingw64

I installed Mingw64.
Then I set up Codeblocks by updating the toolchains executables fields in Settings/compiler.
I was able to run a "Hello world" program.
In the task Monitor the exe is marked "*32"
So it seems it's compiled in x32
(Inferred question: Using MinGW-64, expect to get 64-bit, got 32-bit)
It depends on what MingW-w64 toolchain you have.
You must either add -m64 to the commandline if you have a multilib toolchain, or you need to download a different one which says "targetting Win64" in its name. That is, anything that is found in here. You need to choose what threading and exceptions and such you want. Or, just use the installer.
There are about a dozen different combinations that you can download from the MinGW-w64 site. You need "hosted on Windows, targets Windows", and then either the 64-bit flavor if that is all you want, or the "multi" one, but in this case you need the extra commandline switch.
X32 does not exist under Windows, it's either Win-32 or Win-64.
The solution is to install Mingw64 from Msys2 then just change the compiler settings of Codeblocks so that it points to the Mingw64 folder.
Just copy and paste Mingw64 releases doesn't work in most of the time.

How to compile libdp.dll as 64 bit architecture on windows

I'm trying to build libpd on windows https://github.com/libpd/libpd
The problem I'm having is that when I build with the given "mingw_build.bat" - the libpd.dll that is built is 32 bit architecture.
How can I build using MingW so my resulting DLL is 64 bit architecture?
afaict there is no ready-made solution for this.
here are some generic hints (haven't tried them):
you would need to install mingw64 (the mingw_build.bat seems to assume that you are using mingw32)
fix the paths in mingw_build.bat
additionally set the C-compiler to one that produces 64bit binaries:
CC=x86_64-w64-mingw32-gcc

Gstreamer on windows

I'd like to build application using Gstreamer 1.0 and GTK+-3.0 on Windows 8 (64bit).
I have sucessfully install and build GTK+-3.0, 32 bit version using Dev-C++ and Mingw 32-bit (there is no 64 bit version of GTK+). Everything works perferkt. It also installed pkg-config, I addeded it in %PATH% and it works.
I have installed gstreamer-1.0-devel-x86-1.4.4.msi and gstreamer-1.0-x86-1.4.4.msi from here
1) First problem: it installed itself into I:\gstreamer\ without asking me. I am very unhappy about it, I'd like have it on C:. But its not the biggest problem.
2) pkg-config do not know about gstreamer. I have found in I:\gstreamer\1.0\x86\lib\pkgconfig\ *.pc files, so I looked into gstreamer-1.0.pc and added to my projekt this options:
C compiler:
-I"I:/gstreamer/1.0/x86/include/gstreamer-1.0/"
Linker:
-L"I:/gstreamer/1.0/x86/lib" -lgstreamer-1.0
3) Now the program was compiled, but when I run it, it was not able to find gstreamer-1.0-0.dll. So i tried copy I:\gstreamer\1.0\x86\bin\gstreamer-1.0-0.dll into to the same directory as is my compiled file. Then it was not able to find libwinptread-1.dll. So I copied it also.
Then te program run, but it faild with some error like "cannot find entry point to windows thread ..." (I do not remember it exactly). So I copied ALL dll files from I:\gstreamer\1.0\x86\bin\ and then finally the program run.
But now it is not able to create elements:
source = gst_element_factory_make ("videotestsrc", "source");
//source is null
So, my question is, how to install gstreamer, that my program will find all dll files and will be able to create elements?
installing -- choose "custom install", there you can change the installation path.
for vs you can use *.props (gstreamer\1.0\x86\share\vs\2010\libs)
you need set Environment variable - GST_PLUGIN_SYSTEM_PATH_1_0 to plug-ins. For more details see http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gst-running.html

Cygwin: How to actually use gcc-mingw

Since "gcc -mno-cygwin" does not work anymore, I was looking for a way to get a MinGW-targeted GCC running within my Cygwin environment. (Running a MSYS environment is not an option at this point.)
The Cygwin installer offers a package "gcc-mingw", which installs, among others:
lib/gcc/i686-pc-mingw32/3.4.4/cc1.exe
lib/gcc/i686-pc-mingw32/3.4.4/collect2.exe
lib/gcc/i686-pc-mingw32/3.4.4/crtbegin.o
lib/gcc/i686-pc-mingw32/3.4.4/crtend.o
What is absent is the "gcc" frontend. So, how do I actually invoke this compiler? I hopefully don't have to go through "cc1" manually, have I?
I googled, but couldn't find anything relevant on the subject...
As you already found, you can use gcc-3 with -mno-cygwin. The other possibility is to install the 32-bit and/or 64-bit toolchains from the MinGW-w64 project, which have been packaged for Cygwin very recently and hence are available through setup.exe now. Don't be put off by the rather confusing executable names: i686-w64-mingw32-gcc is the 32-bit compiler and x86_64-w64-mingw32-gcc is the 64-bit one.
Further searches revealed that the MinGW-targeted cross-compiler is not ready yet, and that one has to either use GCC v3 with -mno-cygwin, or install a cross-compiler manually (see link above)...
After installing the MingW g++ package for Cygwin (mingw64-x86_64-gcc-g++), I also struggled to figure out how to invoke it.
Thanks to this wiki, I found out the command was x86_64-w64-mingw32-g++. Then I did alias g++='x86_64-w64-mingw32-g++' and g++ started working as expected.
Cygwin homepage says that "Individual packages like bash, gcc, less, etc. are released independently of the DLL.".
Here you can find how to install gcc under cygwin, so you should also select gcc package during install not only gcc-mingw.

LLVM MinGW installation on Vista?

From llvm.org I've downloaded llvm-2.6-x86-mingw32.tar.bz2 into c:\llvm and llvm-gcc-4.2-2.6-x86-mingw32-tar.bz2 into c:\llvm-gcc as well as setup a desktop shortcut the following batch file in c:\llvm-gcc which attempts to setup an environment for compiling via the llvm-gcc command line too:
#echo off
color 0E
echo Configuring LLVM environment...
set LLVM_LIB_SEARCH_PATH=%~dp0lib
set PATH=c:\llvm;%~dp0bin;%PATH%
Unfortunately, this setup gives the following error when trying to compile a simple hello world program:
C:\CDev\sandbox>llvm-gcc -o hello.exe hello.c
llvm-gcc: CreateProcess: No such file or directory
I've briefly looked through the LLVM binaries and it appears that the MinGW-based Win32 API and runtime files are already included. I also tried adding the MinGW DLL to c:\llvm-gcc\bin to no avail.
What have I missed in setting up the binary LLVM environment and GCC-based front end on Vista?
Thanks, Jon
Because the GNU/MinGW assembler 'as' was required by 'llvm-gcc' to generate the obj file. The problem can be solved by using:
Install GNU/MinGW binutils, extract the as.exe into c:\llvm-gcc\bin
Install a full MinGW package, add %MinGW%\bin your %PATH%
#rwallace is correct that one needs to also install MinGW's binutils along with the LLVM binary download. I've updated the LLVM documentation appropriately at
http://llvm.org/docs/GettingStarted.html#installcf
As far as I can tell, the answer is that the MinGW distribution supplied by LLVM is not complete, in particular, it doesn't come with the 'binutils' programs.
The recommended solution seems to be to download and install MinGW yourself. However, the MinGW download page seems to be saying this requires 10 different packages to be downloaded and installed separately.
The solution I tried today was to use the MinGW that comes with Qt, which does come in a single package; thus far, that appears to work.
It seems like it is looking for the base MinGW installation in C:\MinGW. I just had this error today using gcc.exe in msys. To solve it, I created a symbolic link from c:\msys to c:\MinGW and everything worked.

Resources