On 12/30/2011 08:25, Peter Meyer wrote: > JonY: >> You should be cross compiling for windows, you don't need X11 or any >> Cygwin GTK DLLs. If you do, you're doing it wrong somewhere. > Can you explain this a bit more precise? > > if you compile this Program base.c > > #include <gtk/gtk.h> > int main( int argc, char *argv[] ) > { > GtkWidget *window; > gtk_init (&argc, &argv); > window = gtk_window_new (GTK_WINDOW_TOPLEVEL); > gtk_widget_show (window); > gtk_main (); > return 0; > } > > using: > $ gcc base.c -Wall -o base `pkg-config --cflags --libs gtk+-2.0` >
You are using "gcc" to compile for Cygwin, your pkg-config command will also pull in Cygwin libraries, so it is expected X11 will be involved. The cross compiler is normally x86_64-w64-mingw32-gcc or i686-w64-mingw32-gcc or some such variant. You should be recompiling GTK for win32 also, you can't use native libraries when cross compiling. You may also want to build a specially modified pkg-config for cross compiles, eg i686-w64-mingw32-pkg-config that points to your special PKG_CONFIG_PATH for your Win32 GTK libraries. Cross compile GTK and its dependencies with --build=i686-pc-cygwin --host=i686-w64-mingw32 --prefix=...., use x86_64-w64-mingw32 for win64. > As described in the Basic Gnome GTK Tutorial from > http://www.gtk.org/tutorial1.2/gtk_tut-2.html > > at the Cygwin prompt / console (installed with complete Gnome Options, > with all postinstall tasksare flawless running correctly) the programm > will build and link without Errors. But if you try to start it in the > Cygwin Console ./base.exe yout geht this Message: (base:3460): > Gtk-WARNING **: cannot open display: and the programm aborts. > Otherwise if you select in the Cygwin Installer the X11 Setup Options ( > XServer stuff) you can start X11 with the command "startx" at the Cygwin > Shell, a new Windows Window apears and a minimalistic twm Window > Manageris showing (you can also install KDE or Gnome Desktop) but twm is > ok for testing. The in an xterminal under X11 > you can run the Program using the command ./base.exe and it will > start.Outside Cygwin you have not chance to do this, you need X11, i > have tested it or you get stuck on the (base:3460): Gtk-WARNING **: > cannot open display: But if i install the normal Mingw and tweaking it > a little bit, you can use GTK, without Cygwin and without X11 and cannot > open Display message. > Ditto, you mixed Cygwin with non-Cygwin, don't do that, cross compile all the dependencies as well. > I just finished the crossbuild 32/64-Bit Windows targeting task and > tested it successfully on diffrent Windows Versions in some Virtual > Machines (VMware7) The Win64 Build does not run on Windows XP 32-Bit (ok > thadt was clear, but i tested to make sure it is a real 64-Bit) The > Mingw32 Build (is used your > mingw-w32-bin_i686-mingw_20111101_sezero.zip personal build from Sezero) > i was able to make a good 32-Bit build (wich runs on Windows XP and the > 64-Bit Windows as well (like the > Win64 build, the same list of shared redist DLL's has to be placed in > the Exe Folder side by side). > > I just tested the 32-Bit build on Windows 2000 32-Biz SP4 with latest > patches but there is an Error:"Entry Point Not Found The procedure entry > point ___lc_codepage_func could not be located in the dynamic linl > library msvcrt.dll" I just investigating this problem right now. > This is a problem with the older toolchains, it has been fixed some time ago, you may need to update your mingw-w64 install and/or recompile your code. IIRC this problem plagues early XP SP0 and Win2K (Win2K isn't exactly supported by mingw-w64, so anything goes).
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public