Re: Hello World link errors



On Mon, 2004-02-09 at 01:09, Fazly Fauzy wrote:
> This is my first time using GTK and I am using GTK+ 2.0. I get these
> link errors when I tried to build the hello world program from the
> GTK+ 2.0 tutorial:
> 
> Linking...
> 
> hello world.obj : error LNK2001: unresolved external symbol
> _gtk_widget_destroy
> 
> hello world.obj : error LNK2001: unresolved external symbol "void
> __cdecl gtk_main(void)" (?gtk_main@@$$J0YAXXZ)
> 
> hello world.obj : error LNK2001: unresolved external symbol "void
> __cdecl gtk_widget_show(struct _GtkWidget *)"
> (?gtk_widget_show@@$$J0YAXPAU_GtkWidget@@@Z)
> 
> hello world.obj : error LNK2001: unresolved external symbol "void
> __cdecl gtk_container_add(struct _GtkContainer *,struct _GtkWidget *)"
> (?gtk_container_add@@$$J0YAXPAU_GtkContainer@@PAU_GtkWidget@@@Z)
> 
> hello world.obj : error LNK2001: unresolved external symbol "struct
> _GtkWidget * __cdecl gtk_button_new_with_label(char const *)"
> (?gtk_button_new_with_label@@$$J0YAPAU_GtkWidget@@PBD Z)
> 
> hello world.obj : error LNK2001: unresolved external symbol "unsigned
> long __cdecl gtk_container_get_type(void)"
> (?gtk_container_get_type@@$$J0YAKXZ)
> 
> hello world.obj : error LNK2001: unresolved external symbol "void
> __cdecl gtk_container_set_border_width(struct _GtkContainer *,unsigned
> int)" (?gtk_container_set_border_width@@$$J0YAXPAU_GtkContainer@@I Z)
> 
> hello world.obj : error LNK2001: unresolved external symbol "struct
> _GTypeInstance * __cdecl g_type_check_instance_cast(struct
> _GTypeInstance *,unsigned long)"
> (?g_type_check_instance_cast@@$$J0YAPAU_GTypeInstance@@PAU1 K@Z)
> 
> hello world.obj : error LNK2001: unresolved external symbol "unsigned
> long __cdecl g_signal_connect_data(void *,char const *,void
> (__cdecl*)(void),void *,void (__cdecl*)(void *,struct _GClosure
> *),enum GConnectFlags)"
> (?g_signal_connect_data@@$$J0YAKPAXPBDP6AXXZ0P6AX0PAU_GClosure@@@ZW4GConnectFlags@@@Z)
> 
> hello world.obj : error LNK2001: unresolved external symbol "struct
> _GtkWidget * __cdecl gtk_window_new(enum GtkWindowType)"
> (?gtk_window_new@@$$J0YAPAU_GtkWidget@@W4GtkWindowType@@@Z)
> 
> hello world.obj : error LNK2001: unresolved external symbol "void
> __cdecl gtk_init_abi_check(int *,char * * *,int,unsigned int,unsigned
> int)" (?gtk_init_abi_check@@$$J0YAXPAHPAPAPADHII Z)
> 
> hello world.obj : error LNK2001: unresolved external symbol "void
> __cdecl g_print(char const *,...)" (?g_print@@$$J0YAXPBDZZ)
> 
> hello world.obj : error LNK2001: unresolved external symbol "void
> __cdecl gtk_main_quit(void)" (?gtk_main_quit@@$$J0YAXXZ)
> 
> C:\Documents and Settings\Administrator\My Documents\Visual Studio
> Projects\Test Interface\Debug\Test Interface.exe : fatal error
> LNK1120: 13 unresolved externals
> 
> Build log was saved at "file://c:\Documents and
> Settings\Administrator\My Documents\Visual Studio Projects\Test
> Interface\Test Interface\Debug\BuildLog.htm"
> 
> Test Interface - 14 error(s), 0 warning(s)
> 
>  
> 
> ---------------------- Done ----------------------
> 
> Build: 0 succeeded, 1 failed, 0 skipped
> 
> Do I need to add any other files to my working directory other then
> the header files? I'm also using Visual C++.Net as my compliler.

Copying the header files into your working directory sounds like a bad
approach to me; better to put them somewhere where they can be shared by
multiple projects.

You'll need GTK libraries built for Win32 corresponding to the header
files. Where did you get the header files from?  You'll need to tell the
linker where to find the libraries by adding their path to either the
project settings or to Visual Studio's global linker options.

You'll probably have to edit other linker settings.  Hopefully this page
has more useful information:
http://www.gimp.org/~tml/gimp/win32/

There are probably lots of additional "gotchas" I don't know about; I
haven't used GTK on Win32 (though I've done more than my fair share of
coding in Visual Studio...)

Hopefully someone else (or Google) can give more concrete advice on
getting GTK running on Win32...

Hope this helps; good luck!


>  
> 
> Thank you in advanced for your help
> 
>  
> 
> 
> 
> ______________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE* 
> _______________________________________________ gtk-list mailing list
> gtk-list gnome org http://mail.gnome.org/mailman/listinfo/gtk-list




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