GNOME Bugzilla – Bug 729001
Compile broken after merge of branch 'c++-build'
Last modified: 2018-06-29 23:30:25 UTC
In Ubuntu 13.10 after autogen.sh, configure --enable-compile-warnings, make I get the message: make[1]: Entering directory `/home/michalis/git/gnucash/src/libqof/qof' /bin/bash ../../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/libc -I../../../src -pthread -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -DG_LOG_DOMAIN=\"qof\" -xc++ -Werror -Wdeclaration-after-statement -g -O2 -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wno-unused -MT libgnc_qof_la-gnc-date.lo -MD -MP -MF .deps/libgnc_qof_la-gnc-date.Tpo -c -o libgnc_qof_la-gnc-date.lo `test -f 'gnc-date.c' || echo './'`gnc-date.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/libc -I../../../src -pthread -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -DG_LOG_DOMAIN=\"qof\" -xc++ -Werror -Wdeclaration-after-statement -g -O2 -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wno-unused -MT libgnc_qof_la-gnc-date.lo -MD -MP -MF .deps/libgnc_qof_la-gnc-date.Tpo -c gnc-date.c -fPIC -DPIC -o .libs/libgnc_qof_la-gnc-date.o cc1plus: error: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++ [-Werror] cc1plus: error: command line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++ [-Werror] cc1plus: all warnings being treated as errors make[1]: *** [libgnc_qof_la-gnc-date.lo] Error 1 make[1]: Leaving directory `/home/michalis/git/gnucash/src/libqof/qof' make: *** [all-recursive] Error 1
Confirmed on Fedora 20 as well. Compiler is gcc/g++ 4.8.2. I guess John is compiling with clang.
Confirmed for OpenSUSE 12.3 as well (gcc (SUSE Linux) 4.7.2 20130108 [gcc-4_7-branch revision 195012])
Created attachment 275222 [details] [review] Puts the warnings in AM_CFLAGS so that they're not applied when overriding. Mike Alexander, is this the direction you took as well?
Created attachment 275223 [details] [review] Back off on -Wextra. Forgot that it's too picky.
Comment on attachment 275223 [details] [review] Back off on -Wextra. Forgot that it's too picky. Oops, wrong patch.
Created attachment 275225 [details] [review] The right patch this time! I've gone ahead and pushed this along with another commit with more warning-fixes. master now compiles and completes make check on F18.
Qof build is fixed with this patch, thanks! But now I'm getting loads of these in engine/test: /kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/engine/test/utest-Split.c: In function 'void test_xaccSplitEqualCheckBal(Fixture*, gconstpointer)': /kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/engine/test/utest-Split.c:395:18: warning: deprecated conversion from string constant to 'gchar* {aka char*}' [-Wwrite-strings] gchar *msg = "[xaccSplitEqualCheckBal] test balances differ: 123/100 vs 456/100"; ^ /kobaltnet/janssege/Development/EclipseGnuCash/GnuCash-git/src/engine/test/utest-Split.c:398:62: warning: deprecated conversion from string constant to 'gchar* {aka char*}' [-Wwrite-strings] TestErrorStruct check = { loglevel, "gnc.engine", msg, 0 };
Ubuntu 13.10 gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 I'm getting no errors on Qof build. I'm getting the same errors as Geert on engine tests. And I cannot finish the build with that error: libtool: link: gcc -Werror -Wdeclaration-after-statement -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wno-unused -g -O2 -o .libs/gnucash gnucash-bin.o -pthread -Wl,--export-dynamic ../../src/register/ledger-core/.libs/libgncmod-ledger-core.so ../../src/report/report-gnome/.libs/libgncmod-report-gnome.so ../../src/gnome/.libs/libgnc-gnome.so ../../src/gnome-utils/.libs/libgncmod-gnome-utils.so ../../src/app-utils/.libs/libgncmod-app-utils.so ../../src/engine/.libs/libgncmod-engine.so ../../src/gnc-module/.libs/libgnc-module.so ../../src/core-utils/.libs/libgnc-core-utils.so ../../src/libqof/qof/.libs/libgnc-qof.so -lguile -lgmp -lcrypt /usr/lib/i386-linux-gnu/libltdl.so -lgthread-2.0 -lgmodule-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 /usr/lib/i386-linux-gnu/libcairo.so -lpango-1.0 /usr/lib/i386-linux-gnu/libfreetype.so -lfontconfig -lgobject-2.0 -lglib-2.0 -lprofiler -lm -pthread -Wl,-rpath -Wl,/usr/local/lib/gnucash /usr/bin/ld: cannot find -lprofiler collect2: error: ld returned 1 exit status make[4]: *** [gnucash] Error 1 make[4]: Leaving directory `/home/michalis/git/gnucash/src/bin' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/michalis/git/gnucash/src/bin' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/michalis/git/gnucash/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/michalis/git/gnucash' make: *** [all] Error 2 I have no idea which profiler library is needed, probably something is missing from my system, but it wasn't there before.
The last set of fixes fixes the build again. GnuCash runs fine, with its first set of plastic c++ surgery in place. Yay! I did have to start from a clean build directory. Perhaps make maintainer-clean/autogen.sh/configure.sh would have worked as well but it seems to me that takes just as long.
Successful compile this morning on FC18. Did: make distclean git clean -f ./autogen.sh ./configure $MYOPTIONS make install Happiness.
Works with OpenSUSE 12.3 as well. I guess this bug can be closed as fixed.
Closed.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=729001. Please update any external references or bookmarks.