lightning icon indicating copy to clipboard operation
lightning copied to clipboard

cannot compile since commit 742bcdb2bcbd2ebdd0b1de4921e31214ba72d0d8

Open mocacinno opened this issue 7 years ago • 5 comments

Issue and Steps to Reproduce

I'm trying to compile from the master branch, but it seems i can no longer compile from source since commit 742bcdb2bcbd2ebdd0b1de4921e31214ba72d0d8

wallet/db_sqlite3.c: In function 'trace_sqlite3':
wallet/db_sqlite3.c:14:17: error: expected identifier or '(' before '=' token
  struct db_stmt = (struct db_stmt*)stmtv;
                 ^
wallet/db_sqlite3.c:15:17: error: passing argument 1 of 'db_changes_add' from incompatible pointer type [-Werror=incompatible-pointer-types]
  db_changes_add(stmt, stmt);
                 ^
In file included from wallet/db_sqlite3.c:1:0:
./wallet/db_common.h:145:6: note: expected 'struct db_stmt *' but argument is of type 'const char *'
 void db_changes_add(struct db_stmt *db_stmt, const char * expanded);
      ^
wallet/db_sqlite3.c: In function 'db_sqlite3_exec':
wallet/db_sqlite3.c:89:16: error: 'db' undeclared (first use in this function)
  sqlite3_trace(db->sql, trace_sqlite3, stmt);
                ^
wallet/db_sqlite3.c:89:16: note: each undeclared identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors
<builtin>: recipe for target 'wallet/db_sqlite3.o' failed
make: *** [wallet/db_sqlite3.o] Error 1

Building on ubuntu 16.04.6 LTS

getinfo output

none, cannot compile, so i can't produce getinfo output

mocacinno avatar Sep 11 '19 13:09 mocacinno

I'm having a bit of trouble reproducing this. Which compiler are you using?

For reference I tested with clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) and gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0

Notice that you may need to do a make clean or even make distclean between builds since there may be some stale files that where we're missing a file-dependency in our Makefile target tree.

cdecker avatar Sep 11 '19 18:09 cdecker

Cannot also reproduce, gcc 8.2.0, Gentoo Linux.

kristapsk avatar Sep 11 '19 19:09 kristapsk

@cdecker : I started with a fresh clone of the repo this time (i always make clean before compiling), and it didn't compile either... clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final) gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609

mocacinno avatar Sep 12 '19 05:09 mocacinno

same issue here gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0

wallet/db_sqlite3.c: In function ‘trace_sqlite3’: wallet/db_sqlite3.c:14:17: error: expected identifier or ‘(’ before ‘=’ token struct db_stmt = (struct db_stmt*)stmtv; ^ wallet/db_sqlite3.c:15:17: error: passing argument 1 of ‘db_changes_add’ from incompatible pointer type [-Werror=incompatible-pointer-types] db_changes_add(stmt, stmt); ^ In file included from wallet/db_sqlite3.c:1:0: ./wallet/db_common.h:145:6: note: expected ‘struct db_stmt *’ but argument is of type ‘const char *’ void db_changes_add(struct db_stmt *db_stmt, const char * expanded); ^ wallet/db_sqlite3.c: In function ‘db_sqlite3_exec’: wallet/db_sqlite3.c:89:16: error: ‘db’ undeclared (first use in this function) sqlite3_trace(db->sql, trace_sqlite3, stmt); ^ wallet/db_sqlite3.c:89:16: note: each undeclared identifier is reported only once for each function it appears in cc1: all warnings being treated as errors : recipe for target 'wallet/db_sqlite3.o' failed make: *** [wallet/db_sqlite3.o] Error 1 rm external/libwally-core/src/secp256k1/libsecp256k1.la

chek2fire avatar Sep 17 '19 11:09 chek2fire