i want to create a .exe file which can run on windows. i have written a simple code to generate a window with a button in gtk. i have compiled this code and it is working properly using the command
gcc code.c -o code `pkg-config --cflags --libs gtk+-2.0`
i know using mingw32 .exe files can be created and i have created a .exe file of simple hello world c code using this command
i586-mingw32msvc-gcc hello.c -o hello.exe
when i try to compile a c code having '#include' it gives error
i586-mingw32msvc-gcc code.c -o code.exe `pkg-config --cflags --libs gtk+-2.0`
please guide me step by step and in detail i am new to Ubuntu
You must also install the necessary dependencies, in this case the GTK+ 2.x version libraries, built with mingw32 for cross compiling as well. You cannot link to the libraries as installed on Ubuntu to create a GTK+ program for Windows. You need versions of the libraries built for Windows as well.
These however, are not packaged as part of Ubuntu.
I don't have all the exact details on how to build the libraries for Windows, on Ubuntu, so that you could cross-compile for Windows on Ubuntu. Your best option is to install
VirtualBox
and use a Windows VM for building and testing applications on Windows.