Thank you Brian. Now i've got the clue. When i wrote 'gcc' i ment everything that's installed when you select gcc package in software manager and click Apply/Ok a couple of times. My mistake was that i thought gcc can produce different types of executables depending on a command line switch - some time ago i was playing with nasm that has such a switch so i was misled by that experience. On Sat, 2008-04-12 at 23:24 -0700, Brian Dessent wrote: > Jay wrote: > > > Hi! I'm developing a cross-platform framework and now it's time to port > > it to Win32. I found that i can compile an executable for a certain > > platform specifying -b command-line option however what i found further > > just confused me so i'm here asking you this dumb question: how to > > compile a pe executable using a linux hosted gcc? I run ubuntu 7.10 and > > gcc 4.2.1. Many thanks in advance. > > You need to build a cross toolchain (cross compiler, cross linker, cross > assembler.) Note that gcc is just a compiler, it does not include the > linker or assembler which are part of binutils. > > Just because Linux and Win32 both run on the same ia32 hardware does not > mean you can use the same tools, they are significantly different > targets/platforms (e.g. the PE assembler directives are not the same as > the ELF assembler, the linker is totally different, etc.) > > The MinGW site has some scripts that will build such a set of cross > tools which is a good place to start since there can be a lot of minor > details to get right. Also, those scripts will use gcc sources with > MinGW patches integrated, which fix a number of things that are broken > or unsupported in FSF gcc. Therefore if you have trouble with the > scripts, post on the MinGW list. > > Brian