Re: Questions I should have asked



On Sat, 29 May 2004, Clive Levinson wrote:

/*
 * Hi Alf,
                I find that all one needs to develop for GTK on windows, is a
decent
                text editor and Cygwin.
                1. Install Cygwin

                2. Install GTK runtime and developer packages. I download these
                from http://www.dropline.net/gtk/download.php . It seems that
the maintainer
                of these packages is no longer going to be updating these in the
future.

                3. Create hello.cpp:
*/
#include <gtk/gtk.h>

int main(int argc,char *argv[])
        {
        gtk_init(&argc, &argv);
        GtkWidget *window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_widget_show(window);
        gtk_main();
        return 0;
        }
/*
4. Create hello.o by compiling from the cygwin shell using:
gcc -c -Wall -mno-cygwin -mms-bitfields -O2 `pkg-config --cflags gtk+-2.0`
hello.cpp -o hello.o

5. Link to create the exe:
g++ -Wall -mno-cygwin -mms-bitfields -s -mwindows  hello.o -o hello.exe
`pkg-config --libs gtk+-2.0`

You should now have an executable windows application (that you will have
                                to kill to shutdown).
You can run:
pkg-config --cflags gtk+-2.0
pkg-config --libs gtk+-2.0
from the command line to see what they do if you like?
*/

The result of following your above mentioned suggestions follows:-

C:\dev>\dev-c++\bin\pkg-config --cflags gtk+-2.0
-IC:/dev-c++/include/gtk-2.0 -IC:/dev-c++/lib/gtk-2.0/include -IC:/dev-c++/inclu
de/atk-1.0 -IC:/dev-c++/include/pango-1.0 -IC:/dev-c++/include/glib-2.0 -IC:/dev
-c++/lib/glib-2.0/include

C:\dev>\dev-cpp\bin\gcc -v
Reading specs from /dev-cpp/bin/../lib/gcc-lib/mingw32/3.2/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=
mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable
-languages=f77,c++,objc,ada --disable-win32-registry --disable-shared
Thread model: win32
gcc version 3.2 (mingw special 20020817-1)

C:\dev>\dev-cpp\bin\gcc -c -Wall -mno-cygwin -mms-bitfields -O2 `\dev-c++\bin\pk
g-config --cflags gtk+-2.0` hello.cpp -o hello.o
gcc: cannot specify -o with -c or -S and multiple compilations

It also makes no difference if I use gcc or g++ to compile.
I suspect that we are using different versions of gcc which could well explain
my problems/oppertunities/challenges.
What version are you on?

---

Regards,
Alf Stockton    www.stockton.co.za

Down with categorical imperative!



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