在Visual Studio中链接gtkmm库 [英] Linking gtkmm libraries in Visual Studio
问题描述
pkg-config gtkmm-2.4 --cflags
给出的所有包含目录都输入到了我的项目中,最后它似乎没有问题地编译。 然后我尝试了 pkg-config gtkmm-2.4 --libs
,并得到了
-LC:/ gtk / lib -Lc:/devel/dist/win32/libpng-1.4.3-1/lib -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 - lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0- lgdk_pixbuf-2.0 -lpng14 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl
所以我不知道,我尝试将这些目录(?)添加到要包含在我的项目中的外部库列表中,并且出现此错误:
1> LINK:致命错误LNK1104:无法打开文件'C:/gtk/lib.obj'
我应该为外部库列表做些什么?
您将GLD参数传递给Microsoftlink,您期望什么?需要将一些参数传递给pkg-config,以便它返回链接兼容参数(查看其手册),或手动查找(G)LD手册中这些参数的含义,然后查找相应的链接参数。
-L是LD的包含目录,但它听起来像是链接link static object file / lib,因为它搜索.OBJ。
So I had the same problem as this asker, and followed the advice of the accepted answer. I entered all the include directories given by pkg-config gtkmm-2.4 --cflags
into my project, and finally it seemed to compile without a hitch.
Then I tried pkg-config gtkmm-2.4 --libs
, and got
-LC:/gtk/lib -Lc:/devel/dist/win32/libpng-1.4.3-1/lib -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpng14 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl
So I dunno, I tried adding these directories (?) into the list of external libraries to be included in my project, and I get this error:
1>LINK : fatal error LNK1104: cannot open file 'C:/gtk/lib.obj'
What should I actually be putting for the list of external libraries?
You are passing GLD parameters to Microsoft "link" what do you expect?
Either you need to pass some parameter to pkg-config so that it returns "link" compatible parameters (check its manual), or manually lookup the meaning of those parameters in the (G)LD manual, and then find corresponding parameter for link.
-L is includedirectory for LD, but it sounds like it is "link static object file/lib" for link, since it searches for a .OBJ.
这篇关于在Visual Studio中链接gtkmm库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!