GNOME Bugzilla – Bug 638050
Doesn’t compile on Ubuntu natty
Last modified: 2011-01-11 12:14:03 UTC
‘./autogen.sh && make’ results in CC gitg.o cc1: warnings being treated as errors gitg.c: In function ‘main’: gitg.c:261:2: error: implicit declaration of function ‘gtk_link_button_set_uri_hook’ gitg.c:261:28: error: assignment makes pointer from integer without a cast make[2]: *** [gitg.o] Error 1 because autogen.sh runs configure with --enable-maintainer-mode which implies --enable-deprecations. If I try ‘./configure --disable-deprecations && make’, I get this instead: CCLD shell /usr/bin/ld: shell.o: undefined reference to symbol 'g_file_get_path' /usr/bin/ld: note: 'g_file_get_path' is defined in DSO /usr/lib64/libgio-2.0.so.0 so try adding it to the linker command line /usr/lib64/libgio-2.0.so.0: could not read symbols: Invalid operation collect2: ld returned 1 exit status make[2]: *** [shell] Error 1
I get the same error CC gitg.o gitg.c:41:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘original_link_button_hook’ cc1: warnings being treated as errors gitg.c: In function ‘link_button_uri_hook’: gitg.c:184:3: error: implicit declaration of function ‘original_link_button_hook’ gitg.c: In function ‘main’: gitg.c:261:2: error: ‘original_link_button_hook’ undeclared (first use in this function) gitg.c:261:2: note: each undeclared identifier is reported only once for each function it appears in gitg.c:261:2: error: implicit declaration of function ‘gtk_link_button_set_uri_hook’ gitg.c:261:61: error: ‘GtkLinkButtonUriFunc’ undeclared (first use in this function) gitg.c:261:82: error: expected ‘)’ before ‘link_button_uri_hook’ gitg.c: At top level: gitg.c:172:1: error: ‘link_button_uri_hook’ defined but not used make[2]: *** [gitg.o] Error 1
Well the hooks were deprecated in gtk+ 2.24. But it should still build afaik.
Should, perhaps. But what we’re telling you is that it doesn’t. :-) Can you reread my original report? There really are build problems on Ubuntu natty, both with --enable-deprecations and --disable-deprecations.
Well, for sure there seem to be build problems, but I have no idea what can cause that. Also, 2.24 was never actually released (there is only 2.23 development version), so that's why the deprecations were never a problem. The second issue (when compiling with deprecations disabled) is an issue caused by the new way of doing linking dependencies. Although I really think that this is more likely a libtool issue, it's probably easily solved by the attached patch. Please let me know if that fixes the problem.
Created attachment 177919 [details] [review] Explicit linking in tools and tests
When I said 'I have no idea what can cause that', I didn't look into it yet, now that I have, I do know (to some extend) what caused it, or at least I think I do. I'll see how to fix the deprecations later.
Yeah, the patch in comment 5 lets it build with --disable-deprecations, with several warnings: gitg-commit.c: In function ‘refresh_changes’: gitg-commit.c:712:13: warning: comparison between ‘GitgChangedFileStatus’ and ‘enum <anonymous>’ gitg.c: In function ‘main’: gitg.c:259:2: warning: implicit declaration of function ‘gtk_link_button_set_uri_hook’ gitg.c:259:28: warning: assignment makes pointer from integer without a cast gitg-commit-view.c: In function ‘get_info_at_pointer’: gitg-commit-view.c:973:2: warning: implicit declaration of function ‘gdk_drawable_get_size’ gitg-window.c: In function ‘on_help_about’: gitg-window.c:2258:2: warning: implicit declaration of function ‘gtk_about_dialog_set_url_hook’ gitg-window.c:2259:2: warning: implicit declaration of function ‘gtk_about_dialog_set_email_hook’ The first one is just a typo: if (changes == GITG_CHANGED_FILE_CHANGES_NONE && - status == GITG_CHANGED_FILE_CHANGES_NONE) + status == GITG_CHANGED_FILE_STATUS_NONE)
Er, never mind, those other warnings must have been from another build. In another clean build with --disable-deprecations, I only get the enum warning.
Thanks, I've pushed both. The deprecations I will probably see to later. I'm closing this bug and filed another one to track the deprecations problem for clearity (#639208).