0

it is the third day that I am trying to set up the visual studio 2013 with the GTK libraries. I need to use VS: I've used GCC (both command line and with code blocks) in the past (both on windows and slackware linux too..), but now I have a lot of projects in VS and I want to start making some GUI for them. After seeing that the so called "all-in-one-bundle" is not more available/maintained in the GTK website, I followed a bunch of tutorials (including GTK+ 3.0 setup in Visual Studio 2013, How to configure gtk on Visual studio 2010, How do you install GTK+ 3.0 on Windows?) and I started to install MSYS2 according to this one: https://blogs.gnome.org/nacho/2014/08/01/how-to-build-your-gtk-application-on-windows/. Maybe the problem is here: I followed this step properly pacman -S mingw-w64-x86_64-toolchain, but I skipped the creation of PKGBUILD file and successive installation due to the fact that I did not understand the procedure. Furthermore the mingw toolchaing seemed to be already installed.

Sorry for the big introduction, I wanted to be specific. The problem is at the linking-stage of Visual Studio C Project building. I had also some problem at compilation involving the different inline interpretation of VS (added #define inline __inline // Necessary to make the GTK library Visual Studio compatible definition before calling the GTK header). The linking stage issue consist in the fact that, using pkg-config --libs gtk+-3.0 --msvc-syntax command, I receive a list of files (/libpath:C:/msys64/mingw64/lib gtk-3.lib gdk-3.lib gdi32.lib imm32.lib shell32.lib ole32.lib -Wl,-luuid winmm.lib dwmapi.lib z.lib pangowin32-1.0.lib pangocairo-1.0.lib pango-1.0.lib atk-1.0.lib cairo-gobject.lib cairo.lib gdk_pixbuf-2.0.lib gio-2.0.lib gobject-2.0.lib glib-2.0.lib intl.lib) that does not exists in the msys2 directory. As a consequence I receive this error from the linker: error LNK1104: cannot open file 'gtk-3.lib'.

Someone has the same problem (see Error 3 error LNK1104: cannot open file 'gtk-3.lib'), but the solution is to use the all-in-one-bundle.

What shall I do? Have I followed the correct procedure or am I missing something? I've also tried to link to VS the *.a files located in the lib directory of mingw63 (e.g. libgtk-3.dll.a), but the linker error remains.

Best Regards and thank you for the attention

Davide

Community
  • 1
  • 1
  • there are a couple of items that need to be set in VS for each library. 1) the path to the library in the library paths. 2) the name of the library in the dependencies – user3629249 Dec 28 '15 at 08:52
  • already done. The .lib files listed in the output of the pkg-config command does not exist (I've done a file search) in the msys2 main and sub directories. – Davide Norbiato Dec 28 '15 at 12:52
  • Hello, is there anybody which can answer? I've also tried with the gtk+-bundle_3.6.4-20130513_win64, setting up both compiler include dirs and linker inclue dirs and lib by lib. Lib files, differently from msys2, exists in the bundle, but i get unresolved external errors, e.g. error LNK2019: unresolved external symbol _g_type_check_instance_cast referenced in function _main – Davide Norbiato Dec 31 '15 at 15:34

0 Answers0