#1 2019-10-30 18:56:31

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

cannot build sqlite.c

latest official 3.30.1
using bcc 5.5
Error E2377 amalgamation/sqlite3.c 86762: If statement missing ) in function sqlite3VdbeExec

Offline

#2 2019-10-30 20:46:06

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: cannot build sqlite.c

This is a SQLite3 bug.
Sounds like if they don't support BCC any more.

I had to use C++ Builder XE7 to compile the published version.

Offline

#3 2019-10-30 22:43:04

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

Thanks for quick reply.
Can you try to adjust please to free public compiler for everyone?
X32 is free - command line compiler:

https://www.embarcadero.com/free-tools/ … e-download

Offline

#4 2019-11-14 16:15:16

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

Anyone can help with build sqlite .c using freeware bcc32.exe

Offline

#5 2019-11-14 16:29:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: cannot build sqlite.c

BCC 5.5 won't work any more, since it is not supported by SQLite3 any more.

A newer version could use the very same script as I use with Delphi XE7, I think.

Using the .obj file we supply is the way to go, anyway.

Offline

#6 2019-11-14 17:17:30

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

I mean this free C++ (newer) : https://www.embarcadero.com/free-tools/ … e-download
Not old 5.5

Offline

#7 2019-11-14 18:58:10

zed
Member
From: Belarus
Registered: 2015-02-26
Posts: 105

Re: cannot build sqlite.c

Did you try to use this bat file: https://github.com/synopse/mORMot/blob/ … ite3/c.bat

@echo off

attrib -r sqlite3.obj
del sqlite3.obj

rem set bcc=\dev\bccXE7
set bcc=d:\dev\bcc

%bcc%\bin\bcc32 -6 -Oi -O2 -c -d -u- sqlite3.c

attrib +r sqlite3.obj

pause

or take this (for win64) and adopt it for win32.

Offline

#8 2019-11-14 21:55:06

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

@zed it's not a problem strictly with compiling sqlite but later with Delphi compiler/linker issues fixing.

Last edited by johnnysynop (2019-11-19 12:43:25)

Offline

#9 2019-11-19 12:43:40

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

So nobody can help ?

Offline

#10 2019-11-19 17:28:10

zed
Member
From: Belarus
Registered: 2015-02-26
Posts: 105

Re: cannot build sqlite.c

Explain, what is not working for you?

Offline

#11 2019-11-20 23:41:13

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

Try to build mORMot TestSQL3.dpr with this compiled .obj (latest official 32 bit SQLite obj  successfully builded with mentioned bcc32)
http://www.mediafire.com/file/lg6xfbkvi … 3.obj/file

[dcc32 Error] SynSQLite3Static.pas(790): E2065 Unsatisfied forward or external declaration: 'CodecGetReadKey'
[dcc32 Error] SynSQLite3Static.pas(791): E2065 Unsatisfied forward or external declaration: 'CodecGetWriteKey'
[dcc32 Error] SynSQLite3Static.pas(1017): E2065 Unsatisfied forward or external declaration: 'sqlite3_initialize'
[dcc32 Error] SynSQLite3Static.pas(1018): E2065 Unsatisfied forward or external declaration: 'sqlite3_shutdown'
[dcc32 Fatal Error] SynSQLite3Static.pas(1283): E2226 Compilation terminated; too many errors
Failed
Elapsed time: 00:00:00.7

Offline

#12 2019-11-21 07:20:49

zed
Member
From: Belarus
Registered: 2015-02-26
Posts: 105

Re: cannot build sqlite.c

In your obj file this functions named as _CodecGetReadKey, _CodecGetWriteKey etc. so this is naming convention problem. Maybe there is missing some compiler switches?

Offline

#13 2019-11-21 18:09:19

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

@zed, I don't think so, it's builded similar way as for 64 bit .o

Offline

#14 2019-11-22 07:00:34

zed
Member
From: Belarus
Registered: 2015-02-26
Posts: 105

Re: cannot build sqlite.c

Open SynSQLite3Static.pas and add constant prefix:

  {$ifdef MSWINDOWS}
    {$ifdef CPU64}
      {$L sqlite3.o}  // compiled with C++ Builder 10.3 Community Edition bcc64
    {$else}
      {$L sqlite3.obj}  // compiled with free Borland C++ Compiler 5.5
       const _PREFIX = '_';  // compiled with modern C++ Builder Free compiler (Clang based)   <------ add this
    {$endif}
  {$else}

This will fix name underscore problem and than maybe compilation will be successful.

Offline

#15 2019-11-22 20:02:58

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

[dcc32 Hint] SynSQLite3Static.pas(402): H2164 Variable '__turbofloat' is declared but never used in 'SynSQLite3Static'
[dcc32 Error] SynSQLite3Static.pas(793): E2065 Unsatisfied forward or external declaration: 'CodecGetReadKey'
[dcc32 Error] SynSQLite3Static.pas(794): E2065 Unsatisfied forward or external declaration: 'CodecGetWriteKey'
[dcc32 Error] SynSQLite3Static.pas(1020): E2065 Unsatisfied forward or external declaration: 'sqlite3_initialize'
[dcc32 Error] SynSQLite3Static.pas(1021): E2065 Unsatisfied forward or external declaration: 'sqlite3_shutdown'
....

Offline

#16 2019-11-22 20:47:24

zed
Member
From: Belarus
Registered: 2015-02-26
Posts: 105

Re: cannot build sqlite.c

This errors says that you should continue refactoring SynSQLite3Static.pas if you want to get it work.

Offline

#17 2019-11-22 23:06:35

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

zed It will be better if mORMot will support it ofically, it's more proper because bcc32 is free compiler contrary to XE7 C++ where not everyone has license
+ it's newer compiler with newer features, project like mORMot which is free should also support as first step free c++ compilers as second commercial.
Situation was simpler when bcc 5.5 was supported to sqlite, now it's little bit more complicated.
I think I'm probably not best candidate to make proper changes in this framework.

Offline

#18 2019-11-23 07:59:42

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,534
Website

Re: cannot build sqlite.c

If you cant compile it, why you do not use compiled versions from git?  https://github.com/synopse/mORMot/tree/master/static

Offline

#19 2019-11-23 10:47:02

zed
Member
From: Belarus
Registered: 2015-02-26
Posts: 105

Re: cannot build sqlite.c

mpv
Problem with linking sqlite3.obj compiled with modern Free C++ compiler (Clang based) under Win32. At that moment mORMot uses classic compiler from Community Edition which ships with commercial use limitations: https://www.embarcadero.com/free-tools/ccompiler

Offline

#20 2019-11-26 11:52:34

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

@zed, this is what I mean, Free C++ BCC 32 (community) has commercial usage limits, while this one only command line 32 bit is full and can be used in commercial:
https://www.embarcadero.com/free-tools/ccompiler

That's why I think mORMot should oficially support totally free C++ 32 bit compiler.
One small downside I see is that .obj will take about 1.4 MB comparing to about 0.8 for XE7.

But at least it's 100% free for commercial as well.
BTW: Making support for BCC32C/BCC32X is automatically the same support for C++ Builder community since both are clang based.

@ab can you add official support bcc32 next to XE7?

Last edited by johnnysynop (2019-11-26 11:53:34)

Offline

#21 2020-01-27 08:53:52

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

sadly, still no support for  BCC32C/BCC32X compiler?
https://www.embarcadero.com/free-tools/ … e-download

Why commercial XE7 is preffered over totally free bcc32 (even for commercial usage) compiler to build sqlite?

Offline

#22 2020-01-27 09:04:00

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: cannot build sqlite.c

Because XE7 has less linking dependencies.
If anyone is able to provide me with a recent free BCC32 binary (I don't want to install it), I could try to use it.

Side note:  free old BCC 4.5 is not able to compile SQLite3 any more, and I guess they won't make the fixes for this very old compiler.

Offline

#23 2020-01-27 10:51:20

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

@ab
Fortunately, does not need to be installed it's portable by design.

Found direct URL's for you, no need to register.
https://smadaver.com/index.php?topic=28246.0;wap2

ps. Tokyo(10.2) is max version of freeware BCC32 currently.

Last edited by johnnysynop (2020-01-27 10:52:30)

Offline

#24 2020-01-27 17:45:21

zed
Member
From: Belarus
Registered: 2015-02-26
Posts: 105

Re: cannot build sqlite.c

Embarcadero C++ 10.2 "Tokyo" Compiler and Command-line Tools (Win32 only) direct link:
http://altd.embarcadero.com/download/bc … BCC102.zip (45.2Mb)

The Embarcadero 10.2 Tokyo C++ compiler is a free, Clang-based compiler for 32-bit Windows. The download includes a number of other tools, as well as the Dinkumware STL and headers and import libraries required to build both command-line and GUI Windows applications.

Last edited by zed (2020-01-27 17:52:22)

Offline

#25 2020-01-27 19:14:23

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

@zed  I have already provided URL above which contain even two zip "oryginal"
it's fully capable to build sqlite c code. All is needed to support this is compiler is mormot pas files mod.
@ab, take a look on this please

Last edited by johnnysynop (2020-01-27 20:52:12)

Offline

#26 2020-01-30 12:59:33

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

ab wrote:

..If anyone is able to provide me with a recent free BCC32 binary (I don't want to install it), I could try to use it.

Could you try please smile?

Offline

#27 2020-02-10 14:34:09

johnnysynop
Member
Registered: 2018-07-01
Posts: 29

Re: cannot build sqlite.c

???

Offline

Board footer

Powered by FluxBB