Re: Linking with Gtk+ in VS 8 - pease help!



Maria Shugrina writes:
 > Do I understand correctly that .lib and .dll files can now be used on
 > win32 without library recompilation?

Hmm, your question sounds a bit confusing. Of course the .lib and .dll
files can be used on win32 without recompilation, why else would they
be offered? They are after all win32-specific file formats.

(Note that the "official" distribution for GTK+ for Win32 is from
ftp.gtk.org, though. As far as I know, the gladewin32 site just
repackages the same stuff in "easy-to-use" bundle-all installers,
while ftp.gtk.org has individual zip archives for each package: glib,
atk, cairo, pango, gtk+ and their "external" dependencies like
gettext, libiconv, libpng, zlib.)

 > I included all the header file search paths, all the .lib file names
 > and the library search path into Project Settings.

Good.

 > I also included the DLL search path into the VS search paths.

That doesn't sound relevant. Only when you run the GTK+-using
application you need to make sure it can find the GTK+ DLLs, either by
adding the folder where the DLLs are to the PATH environment variable,
or by placing your application's EXE in the same folder where the GTK+
DLLs are. The DLLs are not needed while compiling and linking your
application.

 > error LNK2019: unresolved external symbol _gtk_init_abi_check
 > referenced in function _main

 > This function is not called from within my program, 

Yes it is. Look in gtkmain.h, you will see this:

#ifdef G_PLATFORM_WIN32
...
#define gtk_init(argc, argv) gtk_init_abi_check (argc, argv, 2, sizeof (GtkWindow), sizeof (GtkBox))
...
#endif

I.e., when you call gtk_init() in your main(), on Win32 you actually
call gtk_init_abi_check().

 > What could be the reason for this error? Is the correct library not
 > being linked?

Are you sure you are linking with gtk-win32-2.0.lib ? That's where
gtk_init_abi_check is defined.

--tml




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