Re[4]: [Dev-C++] Help compiling a GTK+ program
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Denis K. <di...@ya...> - 2004-04-02 07:31:29
|
Wednesday, March 31, 2004, 8:00:44 AM, you wrote:
JJAl> I fixed the problem, this is what the Makefile.win looks now:
// skiped
Look at this makefile.win for simple gtk "hello-world" application
--------------------------------------------------------------------------
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
RES =
OBJ = main.o $(RES)
LINKOBJ = main.o $(RES)
LIBS = -L"D:/Dev-Cpp/lib" -Ld:/dev-cpp/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
INCS = -I"D:/Dev-Cpp/include"
CXXINCS = -I"D:/Dev-Cpp/include/c++" -I"D:/Dev-Cpp/include/c++/mingw32" -I"D:/Dev-Cpp/include/c++/backward" -I"D:/Dev-Cpp/include"
BIN = try.exe
CXXFLAGS = $(CXXINCS)
CFLAGS = $(INCS)-Id:/dev-cpp/include/gtk-2.0 -Id:/dev-cpp/lib/gtk-2.0/include -Id:/dev-cpp/include/atk-1.0 -Id:/dev-cpp/include/pango-1.0 -Id:/dev-cpp/include/glib-2.0 -Id:/dev-cpp/lib/glib-2.0/include -mms-bitfields
.PHONY: all all-before all-after clean clean-custom
all: all-before try.exe all-after
clean: clean-custom
rm -f $(OBJ) $(BIN)
$(BIN): $(OBJ)
$(CC) $(LINKOBJ) -o "try.exe" $(LIBS)
main.o: main.c
$(CC) -c main.c -o main.o $(CFLAGS)
--------------------------------------------------------------------------
Note, that there must be -mms-bitfields option. You can add it
manually to project options - parameters - compiler.
You can create Dev-cpp template with all needed options. Note that it
must be C project. In your makefile:
-------------------------------------------
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o "Gtk_Test.exe" $(LIBS)
-------------------------------------------
you are using C++ compiler - $(CPP).
JJAl> The problems is that none of the C++ toolkits
JJAl> have a books so to learn GUI programming. I, being a complete
JJAl> ignorant when it comes to GUI programming, don't have any other
JJAl> choice but to learn C GUI development with GTK+.
Look at gtkmm (www.gtkmm.org), it's a thin wrapper for Gtk+. It has
tutorial in installation pakage and many examples.
gtkmm is much more easy than Gtk+.
--
Best regards,
Denis
|