Error 3 error LNK1104: cannot open file 'gtk-3.lib'

前端 未结 2 1169
借酒劲吻你
借酒劲吻你 2020-12-06 08:32

I have been trying to get GTK 3.0 to work, and have followed all the steps here

How to configure gtk on Visual studio 2010

And changing to 3.0 where needed

相关标签:
2条回答
  • 2020-12-06 08:51

    you may have to edit your project settings or use a pragma comment to link with your gtk library:

    #pragma comment(lib, "gtk-3")//if the libray is on your project's path
    
    
    #define PATH "C:\\example\\"
    #pragma comment(lib, PATH"gtk-3")//if the library is on PATH
    
    0 讨论(0)
  • 2020-12-06 09:10

    The library gtk-3.lib does not exist. In fact, the library reference is not required to build your GTK 3 application. The pkg-config helper doesn't seem to generate the correct linker flags needed to link your application.

    Just add in your Additional Options area all the existing libraries found in your GTK package (\gtk3\lib). The lib files for my bundle (gtk+-bundle_3.6.4-20130921) were as follows:

    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

    (or you can go to your library path via a command prompt and enter dir *.lib /B)

    Don't forget to include the /ENTRY:mainCRTStartup flag mention in the initial answer you started with.

    0 讨论(0)
提交回复
热议问题