   Compiling for win32 from linux (gcc)
  I can currently compile and run my code on linux with the following makefile. The code is written to be compatible with windows (using cross platform libs like SDL), so as a next step I'm trying to compile an executable in the win32 format.My current makefile (for creating the linux executable) is below. I'm hoping to modify it to output the executable in the win32 format. I tried changing the nasm output format to coff instead of elf, but that wasn't enough and I really don't know what else to do. I've spent several hours RTFM on gcc so please don't just point me there.   OBJS=./src/main.o ./src/sdl.o ./src/input.o ./src/menu.o ./src/mapeng.o ./src/ppe.o ./src/ai.o ./src/enemy.o ./src/player.o ./src/sse_mem.o ./src/rand.oCFLAGS = $(shell sdl-config --cflags)LIBS = $(shell sdl-config --libs) -lSDL_mixerall: linux_app.exe%.o: %.asm   nasm -f elf -i ./include/ -l $*.lst $*.asm%.exe: $(OBJS)   gcc $(LIBS) -Wall -s -O3 -o linux_app $(OBJS)clean:   rm -f ./src/*.o linux_app ./src/*.lst  Any advice whatsoever is appreciated. I've been dabbling with this off and on for around a year w/o much luck. Thanks,--Ben[edited by - atreyu on February 20, 2004 9:14:22 AM]
  What ypu want to achieve is called cross compiling. I don''t know the exacts step, actually I just know the term.Maybe Google or some GCC newsgroups have some insight on this subject.At least this is a better answers that rtfm page ;  http://wiki.wxwindows.org/wiki.pl?Cross-Compiling_Under_Linux ;  OK, I followed the steps necessary to build a gcc cross compiler as outlined here. It must be close, but I''m running into what looks like linker errors still. Do I need to build a nasm-cross-compiler maybe?Here''s an excerpt of the output:  bash-2.05b# ./cross-make.shnasm -f elf -i ./include/ -l src/main.lst src/main.asmnasm -f elf -i ./include/ -l src/sdl.lst src/sdl.asmnasm -f elf -i ./include/ -l src/input.lst src/input.asmnasm -f elf -i ./include/ -l src/menu.lst src/menu.asmnasm -f elf -i ./include/ -l src/mapeng.lst src/mapeng.asmnasm -f elf -i ./include/ -l src/ppe.lst src/ppe.asmnasm -f elf -i ./include/ -l src/ai.lst src/ai.asmnasm -f elf -i ./include/ -l src/enemy.lst src/enemy.asmnasm -f elf -i ./include/ -l src/player.lst src/player.asmnasm -f elf -i ./include/ -l src/sse_mem.lst src/sse_mem.asmnasm -f elf -i ./include/ -l src/rand.lst src/rand.asmgcc -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lSDL_mixer  -Wall -s -O3 -o linux_app ./src/main.o ./src/sdl.o ./src/input.o ./src/menu.o ./src/mapeng.o ./src/ppe.o ./src/ai.o ./src/enemy.o ./src/player.o ./src/sse_mem.o ./src/rand.o./src/main.o(.text+0x19): In function `main'':: undefined reference to `printf''./src/main.o(.text+0x41): In function `main.ValidArgc'':: undefined reference to `strcmp''./src/main.o(.text+0x7e): In function `main.DontAdjustNukes1'':: undefined reference to `strcmp''./src/main.o(.text+0xa5): In function `main.DontAdjustNukes2'':: undefined reference to `strcmp''./src/main.o(.text+0xd7): In function `main.DontAdjustNukes2'':: undefined reference to `strcmp''./src/main.o(.text+0xee): In function `main.DontReadSecondArg'':: undefined reference to `printf''./src/main.o(.text+0x2d8): In function `RunGame.SkipDrawingNukeIcons'':: undefined reference to `fopen''[continues for every library function used in the game]Since gcc is really just acting as a linker (since all the code is in assembly) it''d make sense that nasm needs to be messed with. Do you think I need to find another version though or are there some flags I can specify in the makefile to get the .o files in the correct format? 