SQLite Forum

Errors building with FreeBSD 11.3
Login

Errors building with FreeBSD 11.3

(1) By hruodr on 2020-04-27 17:29:28 [link] [source]

I get above error in FreeBSD 11.3:

shell.c:127:11: fatal error: 'editline/readline.h' file not found

Even if I configure it with --disable-readline or later add add 
--enable-editline.

I have GNU readline installed, and this error disappears if I add 
CPPFLAGS=-I/usr/local/include LDFLAFS=-L/usr/local/lib

The flags are hence completely ignored.

Later I get the following errors:


/usr/opt/Sqlite/src/sqlite/src/tclsqlite.c:2353:33: error: use of undeclared
      identifier 'SQLITE_DBCONFIG_LEGACY_FILE_FORMAT'
        { "legacy_file_format", SQLITE_DBCONFIG_LEGACY_FILE_FORMAT    },
                                ^
/usr/opt/Sqlite/src/sqlite/src/tclsqlite.c:2358:33: error: use of undeclared
      identifier 'SQLITE_DBCONFIG_TRUSTED_SCHEMA'
        { "trusted_schema",     SQLITE_DBCONFIG_TRUSTED_SCHEMA        },
                                ^
/usr/opt/Sqlite/src/sqlite/src/tclsqlite.c:2371:26: error: invalid application
      of 'sizeof' to an incomplete type 'const struct DbConfigChoices []'
      for(ii=0; ii<sizeof(aDbConfig)/sizeof(aDbConfig[0]); ii++){
                         ^~~~~~~~~~~
/usr/opt/Sqlite/src/sqlite/src/tclsqlite.c:2384:26: error: invalid application
      of 'sizeof' to an incomplete type 'const struct DbConfigChoices []'
      for(ii=0; ii<sizeof(aDbConfig)/sizeof(aDbConfig[0]); ii++){
                         ^~~~~~~~~~~
/usr/opt/Sqlite/src/sqlite/src/tclsqlite.c:2387:21: error: invalid application
      of 'sizeof' to an incomplete type 'const struct DbConfigChoices []'
      if( ii>=sizeof(aDbConfig)/sizeof(aDbConfig[0]) ){
                    ^~~~~~~~~~~
/usr/opt/Sqlite/src/sqlite/src/tclsqlite.c:2861:18: error: use of undeclared
      identifier 'SQLITE_INNOCUOUS'
        flags |= SQLITE_INNOCUOUS;
                 ^
/usr/opt/Sqlite/src/sqlite/src/tclsqlite.c:3794:18: error: use of undeclared
      identifier 'SQLITE_OPEN_NOFOLLOW'
        flags |= SQLITE_OPEN_NOFOLLOW;
                 ^
/usr/opt/Sqlite/src/sqlite/src/tclsqlite.c:3796:19: error: use of undeclared
      identifier 'SQLITE_OPEN_NOFOLLOW'
        flags &= ~SQLITE_OPEN_NOFOLLOW;

(2) By Richard Hipp (drh) on 2020-04-27 19:27:58 in reply to 1 [link] [source]

What sources are you using when you see these problems?

(3) By hruodr on 2020-04-27 19:39:02 in reply to 2 [link] [source]

I see 3.31.1 (tried with both, "fossil update" and "fossil update release").

I can compile the tcl interface with just configuring and then doing:

make tclsqlite3.c
cc -o tclsqlite3.o -I/usr/opt/tcl/include -I../sqlite -fPIC -c tclsqlite3.c 
cc -shared -o libtclsqlite3.so tclsqlite3.o -lpthread -L/usr/opt/tcl/lib -ltclstub8.6

(4) By Dan Kennedy (dan) on 2020-04-28 11:27:49 in reply to 1 [link] [source]

I get above error in FreeBSD 11.3:

shell.c:127:11: fatal error: 'editline/readline.h' file not found

Even if I configure it with --disable-readline or later add add --enable-editline.

"editline/readline.h" is part of libeditline, not libreadline. You will need to disable them both. Not sure why the configure script is getting this wrong. Try:

  --disable-readline --disable-editline

Later I get the following errors:

/usr/opt/Sqlite/src/sqlite/src/tclsqlite.c:2353:33: error: use of undeclared identifier 'SQLITE_DBCONFIG_LEGACY_FILE_FORMAT' { "legacy_file_format", SQLITE_DBCONFIG_LEGACY_FILE_FORMAT },

There's probably an old sqlite3.h around somewhere for some reason. Possibly in the directory you're running, possibly in /usr/opt/Sqlite/src/sqlite/src/. If you delete it things might work.

(5) By hruodr on 2020-04-28 12:20:50 in reply to 4 [source]

Thanks. It built. Perhaps was an old sqlite3session.h, I did not see sqlite.h.

On the problem with editline: neither FreeBSD nor OpenBSD has readline.h inside of /usr/include/editline. It is in other places. And it seems only '#include <histedit.h>' is needed.