Re: RES: [Dev-C++] GTK + step by step HOW-TO
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <fer...@te...> - 2003-04-19 06:20:09
|
I used it, but i get some linker errors, this is the output, the program is your sample Compilador: Default compiler Building Makefile: "C:\DEV-CPP\Makefile.win" Finding dependencies for file: C:\DEV-CPP\arq.c Executando make... make.exe -f "C:\DEV-CPP\Makefile.win" all g++.exe arq.o -o "Projeto1.exe" -L"C:/DEV-CPP/lib" -I"C:/DEV-CPP/include" -I"C:/DEV-CPP/include" -IC:/DEV-CPP/include/gtk-2.0 -IC:/DEV-CPP/lib/gtk-2.0/include -IC:/DEV-CPP/include/atk-1.0 -IC:/DEV-CPP/include/pango-1.0 -LC:/DEV-CPP/lib -IC:/DEV-CPP/include/glib -IC:/DEV-CPP/lib/glib-2.0/include arq.o(.text+0x28):arq.c: undefined reference to `gtk_init_abi_check' arq.o(.text+0x35):arq.c: undefined reference to `gtk_window_new' arq.o(.text+0x4d):arq.c: undefined reference to `gtk_main_quit' arq.o(.text+0x62):arq.c: undefined reference to `g_type_check_instance_cast' arq.o(.text+0x6d):arq.c: undefined reference to `g_signal_connect_data' arq.o(.text+0x7e):arq.c: undefined reference to `gtk_widget_show' arq.o(.text+0x86):arq.c: undefined reference to `gtk_main' Execução terminada This is in linker options -LC:/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 appear that it´s placing compiler options in linker options? PS: sorry by my english! Daniel K. O. escreveu: > > In the following web site > > http://www.gimp.org/~tml/gimp/win32/ > > I got many libs and files, I am completely lost! > > I need help and directions on which files I have to > > download. > > > >You need the dev files for GTK+ 2.2.1; this one requires glib, atk, pango, >zlib, libpng, libjpeg and libtiff (this is written on that page), so you >also need to download them (the dev version, if there's more than one). >Unzip everything on dev-cpp's directory (or under MinGW's directory, if you >have it installed somewhere else); > > > > > > Then I step by step procedure on how to integrate it. > > compiler flags, etc. > > > >Download the pkg-config too; if you use a unix-like shell (like MSYS) you >can use it to compile your gtk programs, like on the Gtk documentation: > >gcc program.c -o program.exe `pkg-config gtk+-2.0 --libs --cflags` > > >If you don't want to use a shell to compile your programs, you'll need to >copy/paste the output for: > > >C (or C++) Compiler Flags: > > pkg-config gtk+-2.0 --cflags > > (it will return something like: > -IC:/DEV-CPP/include/gtk-2.0 > -IC:/DEV-CPP/lib/gtk-2.0/include > -IC:/DEV-CPP/include/atk-1.0 > -IC:/DEV-CPP/include/pango-1.0 > -IC:/DEV-CPP/include/glib-2.0 > -IC:/DEV-CPP/lib/glib-2.0/include > ) > > > >Linker Options: > > pkg-config gtk+-2.0 --libs > > (will be something like: > -LC:/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 > ) > > > >So, you can copy/paste it on a GTK+ project on Dev-Cpp. Oh, one more thing: >add the "-mms-bitfields" to the C/C++ flags. > > >Optionally, you can use this as your GTK+ Template (I use this one): > > > >- 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - 8< - > > > >[Template] >ver=1 >Name=GTK >Icon=Gtk.ico >Description=Create a GUI using Gtk. >Catagory=GUI > >[Unit0] >C=Gtk.txt >Cpp=Gtk.txt >CName=main.c >CppName=main.cpp > >[Project] >UnitCount=1 >Type=0 >IsCpp=0 >Compiler=-mms-bitfields_@@_-I"<INCLUDE>\glib-2.0"_@@_-I"<INCLUDE>\atk-1.0"_@ >@_-I"<INCLUDE>\gtk-2.0"_@@_-I"<INCLUDE>\pango-1.0"_@@_-I"<LIB>\glib-2.0\incl >ude"_@@_-I"<LIB>\gtk-2.0\include" >CppCompiler=-mms-bitfields_@@_-I"<INCLUDE>\glib-2.0"_@@_-I"<INCLUDE>\atk-1.0 >"_@@_-I"<INCLUDE>\gtk-2.0"_@@_-I"<INCLUDE>\pango-1.0"_@@_-I"<LIB>\glib-2.0\i >nclude"_@@_-I"<LIB>\gtk-2.0\include" >Linker=-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 >Name=GTK+ Project >ProjectIcon=Gtk.ico > > > >- >8 - >8 - >8 - >8 - >8 - >8 - >8 - >8 - >8 - >8 - >8 - >8 - > > >The "Gtk.txt" file contains a small sample, that I use for almost every GTK+ >program: > >---- >#include <gtk/gtk.h> > >GtkWidget *win; > >int main(int argc, char *argv[]) >{ > gtk_init(&argc, &argv); > > win = gtk_window_new(GTK_WINDOW_TOPLEVEL); > g_signal_connect(G_OBJECT(win), "destroy", >G_CALLBACK(gtk_main_quit), NULL); > gtk_widget_show(win); > > gtk_main(); >} >--- > > > > > > > > > > I tried to browse this list files, but I could not get > > clear information ( at least to me ) on how to do > > that. > > > >I answered this question a few times here, but I'll forgive you, the search >engine on SourceForge is broken... :) > > > > >Daniel K. O. > > >Only ask questions with yes/no answers if you want "yes" or "no" as the >answer. >http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-an >swers.html > > > > > > > > > >------------------------------------------------------- >This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger >for complex code. Debugging C/C++ programs can leave you feeling lost and >disoriented. TotalView can help you find your way. Available on major UNIX >and Linux platforms. Try it free. www.etnus.com >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >. > > > |