Re: Linux build in Windows

From: Robert Heller (heller_at_deepsoft.com)
Date: 09/18/05


Date: Sun, 18 Sep 2005 17:49:44 +0200


  "googler" <pinaki_m77@yahoo.com>,
  In a message on 17 Sep 2005 15:10:56 -0700, wrote :

"> I need to compile a program for both Linux and Windows environments.
"> I'm working on a Windows machine and want to perform both these builds
"> on this same computer. How can I perform a compilation for Linux
"> environment in Windows?
">
"> I thought Cygwin is able to perform this task, but after reading from
"> their website, it appeared that it generates the executable for
"> Windows. Is that right? I want the binaries for Linux.

Cygwin is built to build UNIX programs to run *natively* under
MS-Windows (using POSIX libraries), using GNU build tools (gcc/g++ +
binutils + other gnu tools: make, libtool, auto{conf,make,scan}, etc.).

You build gcc and binutils (and maybe some additional libraries) as a
cross-build environment under Cygwin, from the *sources* for gcc and
binutils (and the libraries you need). You are probably NOT going to
find these as pre-built binaries. Just find and download the sources
for gcc (gcc-<mumble>.tar.gz and binutils-<mumble>.tar.gz), unpack them
and study the READMEs. You'll want *hardcopies* of the READMEs --
building the cross-build environment is a non trivial task -- there are
a number of steps in the process. You might need to fetch some bits
and pieces from a real Linux environment as well (libraries and header
files) -- way back when (don't ask) I needed to build a gcc cross
compiler and there were some bits that had to be native built (somehow)
-- some low-level libraries (libgcc.a I think). I don't know if that
is still the case or if it was because the underlying processors were
different (a 680xx compiler for a 68020 SBC with some embeded UNIX-ish
O/S, on a SparcStation runing SunOS 3.x or 4.x). When I (much more
recently) built a Mgwin32-based cross build for MS-Windows on a Linux
box, it included installing a pile of pre-built .dlls/.libs.

It is (of course) easier to build a cross-build environment for
MS-WIndows under Linux, using Mgwin32...

Even easier would be to use a dual boot box or a second (cheap/older) PC
running Linux. The linux box can be headless even -- you can just
slogin in from the Windows box. Cygwin comes with a basic X server
even.

">
"> Thanks in advance.
">
">

                                     \/
Robert Heller ||InterNet: heller@cs.umass.edu
http://vis-www.cs.umass.edu/~heller || heller@deepsoft.com
http://www.deepsoft.com /\FidoNet: 1:321/153

                                    



Relevant Pages

  • Re: Which JVM to use under Windows?
    ... "Home users" are using Windows. ... Why on earth would you be coding Java using an obsolete ... Microsoft's environment from the day one, ... Linux, and what I found is that they are clunky. ...
    (comp.lang.java.programmer)
  • Re: Why is it dangerous?
    ... When I compile a program from our C course with a windows compiler ... Is linux more dangerous than windows? ... to the first character in a buffer, and stores an entire line from stdin ...
    (comp.lang.c)
  • Re: C++ with VS.NET and Twilight of the Microsoft Era
    ... this has to do diddly squat with the compiler used to compile ... VC6 is of the same generation. ... Most of the time we use the best tool for the job, and on windows, VC++ is ... tried to use GDB and DDD on linux to debug multithreaded frameworks. ...
    (microsoft.public.vc.language)
  • Re: Einsteig in Microcontroller und Programmierung
    ... Linux Format nix anfangen kann. ... Problem und der Ignoranz von anderen Systemen für Quellcode Änderungen ... Und wenn ein Compiler abkackt, weil er ohne CR nicht leben kann, ist der ... Unter Windows konzernweit entwickelt und compiliert. ...
    (de.sci.electronics)
  • Re: Windows Compilation Madness
    ... There is a compiler, ... the compilation problems that arise in the Windows environment? ... Can a Windows expert confirm my understanding that: ... MinGW uses the VC6 runtime libraries, but the compilers ...
    (comp.lang.ruby)