Re: Linux -> win32 cross-compile



Thanks for your reply. I am one step further now; I get my app to compile 
with the Windows-headers (the parse errors were caused by the files having 
CRLF line-terminators). However, it still doesn't link. One thing I 
noticed about the symbols in my .a-files (which I got from the same place 
you mentioned) is that they all have 0 as their value (according to the 
cross-nm). This makes me wonder two things:
1. Are your symbol values also 0? If not, what should I do to get mine 
right?
2. What commands do you use for compiling and linking? I use

gcc -c  -I/usr/local/cross-tools/include/gtk-2.0 -I/usr/local/cross-
tools/lib/gtk-2.0/include -I/usr/local/cross-tools/include/atk-1.0 -
I/usr/local/cross-tools/include/pango-1.0 -I/usr/local/cross-
tools/include/glib-2.0 -I/usr/local/cross-tools/lib/glib-2.0/include   
hello.c

for compiling, and

gcc -o hello.exe  -I/usr/local/cross-tools/include/gtk-2.0 -
I/usr/local/cross-tools/lib/gtk-2.0/include -I/usr/local/cross-
tools/include/atk-1.0 -I/usr/local/cross-tools/include/pango-1.0 -
I/usr/local/cross-tools/include/glib-2.0 -I/usr/local/cross-tools/lib/glib-
2.0/include    -L/usr/local/cross-tools/lib -lgtk-win32-2.0 -lgdk-win32-
2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpango-1.0 -
lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv   hello.o

for linking (both with environments set up so that the cross-tools will be 
used instead of the Linux tools). The first command works fine, the second 
gives lots of errors like

hello.o(.text+0x199):hello.c: undefined reference to `gtk_main'

I use the pkg-config that came with my GTK for Linux, but with 
PKG_CONFIG_PATH set to use the .pc-files for the Windows files. I have the 
feeling I'm almost there, just missing one little thing...



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]