编译Vala应用程序时“未定义对`gtk_label_set_xalign'的引用”

时间:2015-09-10 10:23:18

标签: user-interface cmake alignment label vala

我正在编写Vala应用程序,并在其中使用标签。这是构造函数(我想这是导致错误的地方):

titleLabel = new Gtk.Label("");
titleLabel.set_markup(wrapInTags(post.title));
titleLabel.set_line_wrap(true);
titleLabel.wrap_mode = Pango.WrapMode.WORD_CHAR;
titleLabel.set_justify(Gtk.Justification.LEFT);
//titleLabel.set_max_width_chars(40);
titleLabel.set_xalign(0);

当我编译它时,会发生这种情况:

CMakeFiles/photostream.dir/Widgets/PostBox.c.o: In function `photo_stream_widgets_post_box_construct':
PostBox.c:(.text+0x2111): undefined reference to `gtk_label_set_xalign'
CMakeFiles/photostream.dir/Widgets/CommentsBox.c.o: In function `photo_stream_widgets_comment_box_construct':
CommentsBox.c:(.text+0x1045): undefined reference to `gtk_label_set_xalign'
CMakeFiles/photostream.dir/Widgets/NewsBox.c.o: In function `photo_stream_widgets_news_box_construct':
NewsBox.c:(.text+0x1af8): undefined reference to `gtk_label_set_xalign'
CMakeFiles/photostream.dir/Windows/BulkDownloadWindow.c.o: In function `photo_stream_bulk_download_window_construct':
BulkDownloadWindow.c:(.text+0x14b1): undefined reference to `gtk_label_set_xalign'
collect2: error: ld returned 1 exit status

我尝试用titleLabel.xalign = 0替换最后一个字符串,但结果仍然相同。

我该如何解决?

0 个答案:

没有答案