How do I compile a crosscompiler targeting Linux x64 on a Windows host? - windows

I am planning on harvesting my gaming HTPCs spare cycles for compiling my software using distcc, but I will need to set up a cross compiler. The problem is that Google is sadly lacking in relevant information.

I think Cygwin is the purest form of evil, but is the easiest way of doing what you want.
You will just have to install the correct version of gcc from the cygwin installer.
This website has the answer here

Related

Compiling software in cygwin requires cygwin libraries to run

I have just compiled some software in cygwin and all went well, except when I tried to run it on a different machine it required some cygwin specific libraries .dll's, is there anyway I can build this in with the software so it can run on third party machines without cygwin installed? Im trying to be generic with the question so the answer will suit other people facing the same or similar problem so sorry for the lack of detail on the software etc. (sgminer)
Thanks for any help
Not only is this a duplicate, as Paul R point out, it's also an FAQ on the Cygwin site.
From "How do I compile a Win32 executable that doesn't use Cygwin?"
The compilers provided by the mingw-gcc, mingw64-i686-gcc, and
mingw64-x86_64-gcc packages link against standard Microsoft DLLs
instead of Cygwin. This is desirable for native Windows programs that
don't need a UNIX emulation layer.
This is not to be confused with 'MinGW' (Minimalist GNU for Windows),
which is a completely separate effort. That project's home page is
http://www.mingw.org/index.shtml.

install and use GCC in windows 7 x64

I am new to GCC, don't know much about it. I want to install it on my Windows 7 64bit PC and use it for C, C++ and Java. The latest version is GCC-4.8.0. In their mirror links, I am getting option to download gcc 4.8.0.tar.bz2 and gcc 4.8.0.tar.gz and md5.sum. Please guide me, how should i proceed, to use GCC
On Windows, easiest way to get gcc is to install MinGW.
Most recent MinGW release has support for gcc 4.8 as well - but it may be not very stable at the moment.
These files are source archive files of the latest released GCC compiler.
As a newbie, you probably want a binary distribution, e.g. mingw or cygwin on Windows. (Then you might get an earlier version of GCC. 4.8 has just been released)
Alternatively, consider switching to Linux and install it on your machine. It will teach you a big lot (and almost all of Linux is free software so you can get its source code and study it).
Using Linux and GCC also gives you a significant advantage: you could use GCC plugins, e.g. develop your own MELT extension (MELT is a domain specific language to extend GCC, implemented as a [meta-]plugin). Neither Mingw nor Cygwin support GCC plugins.
PS. compiling GCC from source code is not easy for a newbie.
this is an older question but this was harder to search for than it should have been so I will post it here, http://gcc.gnu.org/wiki/WindowsBuilding is a quick guide to getting gcc4.8 running on windows. I am about to dive in to building it on my old windows-xp box. wish me luck.
I use codeblocks . You can follow this Youtube video for instructions:). Hope it helps!
http://www.youtube.com/watch?v=nNeySMSW8qU
You should really check out Code::Blocks (http://codeblocks.org/).
It's a good IDE which is easily set up to get you started.
To support Windows 64-bit though you should not use the MinGW compiler that comes with it. Instead get a separate binary of MinGW-w64 with 64-bit support.
You can get it from http://winlibs.com where you can also find tips on how to configure both Windows 32-bit and 64-bit compilers.

Distributed GNU Make for Win32

Is there a version of GNU Make, or GNU Make compatible application, which supports distributed builds on Win32?
We currently have a large project using gnu makefiles. We use the Win32 version of GMake to build. Our build environment supports parallel builds without a problem, and we'd like to try and perform a distributed build if possible.
Any ideas?
distcc is the grand-father of doing this, though I'm not sure it would be easy to get running on win32. cygwin might make this possible.
I'd try Cygwin but the performance might be poor because of the emulation layer.
I hope I've understood Your problem properely, but
You can use:
Cygwin
or
mingw
MinGw is a complete port of GNU binutils for windows.
ElectricAccelerator from Electric Cloud does exactly this. It's a parallel, distributed replacement for gmake and nmake. If your build problem is bad enough and you have some budget to spend on a solution, you should check it out:
ElectricAccelerator home page
Disclaimer: I'm the tech lead for the Accelerator team at Electric Cloud.

Why does Mingw exist?

MSYS and UNIX-like build systems apart; why does Mingw exist? What I mean is, why isn't win32/64 just another target available in "vanilla GCC"? Are there technical reasons for this or are they "political"? It would seem to me that there isn't really anything special about the Windows platform that would make a GCC port to it "incompatible" with the original GCC.
Mingw isn't just the compilers - it's also the libraries and headers (and whatever other support files you might need).
GCC is just a compiler. Mingw is a full environment.
MingW is intended to allow easy porting of Posix apps to windows. It's simply a "thinner" layer than CygWin, so not everything might work where windows too different. CygWin allows provides enough insulation that even the scripting tools to build and generate code run.
Edit:
Microsoft is very fond of making there own standards, and want to put there own brand on things for which open standards already exist. i.e. OpenGL -> DirectX, Java -> .net, OpenCL is the next standard they want to spurn. This makes them a bit of a pain for non sponsored project to support them as a target. They have always turned away from anything that allows easy cross platform development, because they only want you to develop your app for there OS. It's a marketing strategy, control the brand, control the platform, and make it painful for people to support other OSes. MingW is required because GCC can generate x86 code, but even the most basic runtime support is different than Posix based OSes.
well, while you can use cross compiler to produce win32/64 binary codes from GCC, someone has to port all the C runtime libraries across though. Both Mingw and Cygwin are created for this purpose.
From MinGW's main site
Offered in easily installed binary package format, for native deployment on MS-Windows, or user-built from source, for cross-hosted use on Unix or GNU/Linux, the suite exploits Microsoft's standard system DLLs to provide the C-Runtime and Windows API.

installing gcc on vista

I downloaded gcc 4.4.0 and unzipped it to C:\Program Files\gcc
forgive me for being a novice, but...now what? I read the install readme file but it's over my head. how do i get it to work?
If it were me, I would just start with cygwin in the first place. If you do, most of the Unix/Linux/BSD faq's and tutorials will "just work".
If you're new to gcc and want to start using it on Windows, I highly recommend the MinGW GUI installer.
If you want to do C/C++ programming for fun, Mingw is the simpler way to go about it. You'll also need some libraries to get you started.
Try: http://nuwen.net/mingw.html
It's a Mingw distribution based on GCC 4.3.3
It also contains: binutils, boost (with compiled headers), SDL, libbzip, libjpeg, libvorbis, freetype, and many other libraries.
EDIT: I'm not sure if any of the precompiled stuff will work on Vista. I've only tried it on WinXP.
If you want to Install, you can install Dev C++, which is actually MinGW with GUI. Dev C++ can probably be clubbed wth cygwin too though I havn't tried it out ever.
Even if the name says C++ in Dev C++, don't worry. I have tried and it does compile C programs as well. I am recommending Dev C++ because most people on Windows have a habit of using GUI for everything in contrast to be people from *nix background.
You can download it from here
It also includes GDB which is the debugger you can use. If you are don't know how to use gdb this tutorial can come handy.
Another aspect of Dev C++ is that it's development has probably ceased as no new versions have been released since Feb,2005 which is more than 4 years. People still use Dev C++ as it does it's job right. The latest version has GCC 3.4.2 bundled with it.
If you are interested in running the most latest or using newer versions of gcc, then you should try out wxDev C++ is an extension of Dev C++. The latest RC was made available somewhere in 1 yr back. It even has in built CVS support
Now since you require GCC 4.4.0 , it is available on MinGW site. Try to replace the older gcc dll in Dev C++/wxDev C++ with the newer one from this site.
You will edit the environment variable "PATH" to include C:\Program Files\gcc\bin.
(source: justrealized.com)
Then you can use gcc just like in Linux.

Resources