我尝试在Code:Blocks中添加gtk +。但是,当我尝试运行并编译代码(来自代码块的Iv'e代码)时,出现错误cannot find -lintl | error: ld returned 1 exit status
如何使-lintl找到?如何将其添加到项目\计算机中?
编辑:这是我得到的生成日志:
Checking for existence: C:\Users\magshimim\Documents\Test\main.exe
-------------- Build file: "no target" in "no project" (compiler: unknown)---------------
mingw32-gcc.exe -mms-bitfields -IC:/gtk/include/gtk-3.0 -IC:/gtk/include/cairo -IC:/gtk/include/pango-1.0 -IC:/gtk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/pixman-1 -IC:/gtk/include -IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/gtk/include/libpng15 -IC:/gtk/include/gdk-pixbuf-2.0 -IC:/gtk/include/libpng15 -IC:/gtk/include/glib-2.0 -IC:/gtk/lib/glib-2.0/include -c C:\Users\magshimim\Documents\Test\main.c -o C:\Users\magshimim\Documents\Test\main.o
C:\Users\magshimim\Documents\Test\main.c: In function 'main':
C:\Users\magshimim\Documents\Test\main.c:34:3: warning: 'gtk_vbox_new' is deprecated: Use 'gtk_box_new' instead [-Wdeprecated-declarations]
vbox = gtk_vbox_new (TRUE, 6);
^
In file included from C:/gtk/include/gtk-3.0/gtk/gtk.h:245:0,
from C:\Users\magshimim\Documents\Test\main.c:2:
C:/gtk/include/gtk-3.0/gtk/deprecated/gtkvbox.h:60:13: note: declared here
GtkWidget * gtk_vbox_new (gboolean homogeneous,
^
mingw32-g++.exe -o C:\Users\magshimim\Documents\Test\main.exe C:\Users\magshimim\Documents\Test\main.o -LC:/gtk/lib -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lpangocairo-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lintl
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 1 warning(s) (0 minute(s), 0 second(s))
最佳答案
我不确定在Windows中如何实现此功能,但是在Linux中,没有这样的库(至少不是字面上的libintl.so
)。虽然有一个libintl.h
,所以我怀疑没有libintl
的实际代码-只是定义(宏)。
因此,建议您尝试在命令行中不使用-lintl
的情况下进行编译。
您可以在磁盘上检查minggw软件包的库目录中是否存在库libintl
(。dll?),但我对此表示怀疑。