0

Lately I have been pursuing C with GTK 3. However, a major problem I've been having is getting it to work with Microsoft Visual Studio 2013. To configure it, I begin by following the steps from the question here: How to configure gtk on Visual studio 2010

However, under the Include Directories there is no

$(GTKDIR)\lib\gtk-3.0\include

equivalent for GTK3.6.4.

As for the next step, the library directory is fine. As the first part doesn't work, the rest of the steps with setting the compiler and linker flags don't work properly. Finally, due to my lack of familiarity in Visual Studio 2013, I can't seem to find the Additional Options menu item from the following question: Error 3 error LNK1104: cannot open file 'gtk-3.lib'.

Can I get a general set of steps to follow similar to the first link adapted to 3.6.4? This might be useful to future users as well.

Thanks for the help!

EDIT: My problem after doing all of the above, with the following in the linker's Additional options:

/libpath:C:/gtk/atk-1.0.lib cairo.lib fontconfig.lib gailutil.lib gdk-win32-3.0.lib gdk_pixbuf-2.0.lib gio-2.0.lib glib-2.0.lib gmodule-2.0.lib gobject-2.0.lib gthread-2.0.lib gtk-win32-3.0.lib pango-1.0.lib pangocairo-1.0.lib pangoft2-1.0.lib pangowin32-1.0.lib /ENTRY:mainCRTStartup

is still not working. It has unresolved externals for every GTK3-related call.

Community
  • 1
  • 1
Hathor
  • 187
  • 1
  • 2
  • 10

1 Answers1

0

The linker should not look for 'gtk-3.lib' - instead you should use gtk-win32-3.0.lib which is Windows version of this library.

Check the project settings (in Project Properties -> Linker) for this library.

Also if your GTK 3 directory structure was not changed you should use

#include <gtk-3.0/gtk/gtk.h>

in your source files to include the GTK stuff.

(E.g. in my machine the full path is d:\Data\GTK\include\gtk-3.0\gtk\ where $(GTKDIR) is d:\Data\GTK\ -- the same is applied to lib paths.)

Slappy
  • 5,250
  • 1
  • 23
  • 29