Thread: [Dev-C++] Problem linking simple GTK+ prog with Dev-Cpp 4.9.5.0
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Mark B. <jmb...@ea...> - 2002-08-10 12:55:06
|
Hello. I'm trying to get the GTK+ 2.0.3 package to work correctly with my
Dev-Cpp install on Win2k. I'm using the default minGW complier that comes
with Dev-Cpp, and I've installed all the Dev-Cpp updates that the update
tool says are available.
I believe that I have the include directories properly registered with the
IDE. What I'm getting are linking errors.
[Linker error] undefined reference to `gtk_init_abi_check'
[Linker error] undefined reference to `gtk_window_new'
[Linker error] undefined reference to `gtk_widget_show'
[Linker error] undefined reference to `gtk_main'
Here is the simple program I'm trying to get to compile and run correctly as
a test of my GTK setup:
#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;
}
As I said, a simple test program.
I'm sure that there's something I haven't configured correctly that is
causing the problem. Could it be that I need to insert '-lglib' and
'-lgtk+' in my compiler options somewhere?
Thanks for any assistance.
Mark Brooks
|
|
From: Mark B. <jmb...@ea...> - 2002-08-10 14:20:06
|
One other note. I installed GTK+ with the package manager.
Mark Brooks
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...]On Behalf Of Mark
> Brooks
> Sent: Saturday, August 10, 2002 8:56 AM
> To: dev...@li...
> Subject: [Dev-C++] Problem linking simple GTK+ prog with Dev-Cpp 4.9.5.0
>
>
> Hello. I'm trying to get the GTK+ 2.0.3 package to work correctly with my
> Dev-Cpp install on Win2k. I'm using the default minGW complier that comes
> with Dev-Cpp, and I've installed all the Dev-Cpp updates that the update
> tool says are available.
>
> I believe that I have the include directories properly registered with the
> IDE. What I'm getting are linking errors.
>
> [Linker error] undefined reference to `gtk_init_abi_check'
> [Linker error] undefined reference to `gtk_window_new'
> [Linker error] undefined reference to `gtk_widget_show'
> [Linker error] undefined reference to `gtk_main'
>
> Here is the simple program I'm trying to get to compile and run
> correctly as
> a test of my GTK setup:
>
> #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;
>
> }
>
> As I said, a simple test program.
>
> I'm sure that there's something I haven't configured correctly that is
> causing the problem. Could it be that I need to insert '-lglib' and
> '-lgtk+' in my compiler options somewhere?
>
> Thanks for any assistance.
>
> Mark Brooks
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> 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
|
|
From: Hongli L. <h....@ch...> - 2002-08-10 15:46:39
|
On Sat, 2002-08-10 at 14:55, Mark Brooks wrote: > Hello. I'm trying to get the GTK+ 2.0.3 package to work correctly with my > Dev-Cpp install on Win2k. I'm using the default minGW complier that comes > with Dev-Cpp, and I've installed all the Dev-Cpp updates that the update > tool says are available. Use the GTK+ *template*. |
|
From: Mark B. <jmb...@ea...> - 2002-08-10 23:53:07
|
There doesn't appear to get a GTK+ template. Why would that solve linker problems? There does appear to be a wxWindows template. Mark Brooks |
|
From: Hongli L. <h....@ch...> - 2002-08-11 09:55:16
|
On Sun, 2002-08-11 at 01:53, Mark Brooks wrote: > There doesn't appear to get a GTK+ template. Why would that solve linker > problems? Because the template includes the nescessery compiler and linker flags, as well as example code. After all. that's what templates are all about! Compiler flags: -I"<INCLUDE>\gtk-2.0" -I"<INCLUDE>\gtkdeps-2.0" -I"<LIB>\gtk-2.0\include" -I"<INCLUDE>\atk-1.0" -I"<INCLUDE>\pango-1.0" -I"<INCLUDE>\glib-2.0" -I"<LIB>\glib-2.0" -I"<LIB>\glib-2.0\include" -fnative-struct Linker flags: -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -luuid -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -liconv -lintl -mno-cygwin -fnative-struct |
|
From: Mark B. <jmb...@ea...> - 2002-08-11 15:55:59
|
Thank you. I wonder why I can't find the template? Weird. Mark Brooks > -----Original Message----- > From: Hongli Lai [mailto:h....@ch...] > Sent: Sunday, August 11, 2002 6:01 AM > To: Mark Brooks > Cc: dev...@li... > Subject: RE: [Dev-C++] Problem linking simple GTK+ prog with Dev-Cpp > 4.9.5.0 > > > On Sun, 2002-08-11 at 01:53, Mark Brooks wrote: > > There doesn't appear to get a GTK+ template. Why would that > solve linker > > problems? > > Because the template includes the nescessery compiler and linker flags, > as well as example code. After all. that's what templates are all about! > > Compiler flags: > -I"<INCLUDE>\gtk-2.0" -I"<INCLUDE>\gtkdeps-2.0" > -I"<LIB>\gtk-2.0\include" -I"<INCLUDE>\atk-1.0" -I"<INCLUDE>\pango-1.0" > -I"<INCLUDE>\glib-2.0" -I"<LIB>\glib-2.0" -I"<LIB>\glib-2.0\include" > -fnative-struct > > Linker flags: > -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -luuid > -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangowin32-1.0 -lgdi32 -lpango-1.0 > -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -liconv -lintl -mno-cygwin > -fnative-struct > > |