NO

Author Topic: Can't compile SQLite -- "internal error"  (Read 16555 times)

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Can't compile SQLite -- "internal error"
« Reply #15 on: January 03, 2013, 12:00:03 PM »
Jassing,
Sqlite, as already said, is write to compile on as many platforms as possible WIN or *IX (see the code). This is done through strong use of *IX tools that automatically configure the compiler. Moreover the configuration to produce a DLL or a static library is selected defining or undefining some symbols, not simply changing compiler settings.
So:
 - What you get to compile is something 'preconfigured' that needs more defs to adapt to your compiler (read SQLITE documentation and documentation inside code)
  - Are you able to compile 'as is' on other C compilers? (should be tried before to blame anything).
 - For others works because they compile a DLL, as *not completely configured*, not a static library
- You can borrow configuration files to compile SQLITE 3 and 4 from samples made by Timovjl (are somewhere in the forum)

I don't have time to read doc's for SQLite, but you should find time to do it if you want compile it, and it could be usefull to at least take a look at code before copy files and push compile.  8)

Last the internal error is normal with the 'unconfigured' version....
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Can't compile SQLite -- "internal error"
« Reply #16 on: January 03, 2013, 01:38:25 PM »
Pellesc can't optimize function int sqlite3VdbeExec()
Take optimization off or put #pragma optimize(none) before it and #pragma optimize() after it.

POCC.EXE: Version 7.00.25
Code: [Select]
> pocc.exe -std:C11 -Tx86-coff -Ot -Ob1 -fp:precise -W1 -Gd -Ze -DWIN32_MEAN_AND_LEAN  "C:\CODE\sqlite-amalgamation-3071501\sqlite3.c" -Fo"C:\CODE\sqlite-amalgamation-3071501\output\sqlite3.obj"
Code: [Select]
C:\CODE\sqlite-amalgamation-3071501\sqlite3.c(64029): fatal error: Internal error: get_rule_number().
EDIT: You can compile it with optimization on, if you add compiler option /Gi Emits code to check for signed integer overflow. [7.00]
« Last Edit: January 03, 2013, 10:48:51 PM by timovjl »
May the source be with you

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Can't compile SQLite -- "internal error"
« Reply #17 on: January 03, 2013, 07:44:45 PM »
I just made a test.
I can compile everything: static lib, DLL and shell with no problems at all.
Timovjl with the compiler 7.00.355 is no more required to disable optimization, register spilling problem seems to have been solved.
Only two points: remember to force calling convention to cdecl that is the standard flavour of SQLite (Project options->compiler->calling conv:__cdecl). Second when creating the DLL define the following symbol "SQLITE_API=__declspec(dllexport)" (Project options->compiler->define preprocessor symbols:).
The warnings are harmless: the unreachable code is due to some if's checking constants (because the constant could not change the test will always have the same result so the code in the 'if' body or the 'else' body, depending on the result, cannot be never reached in runtime so it is omitted). The second " warning #2214: Address of import '<some Win API function' is not static, identity not guaranteed" is due to the strange indeed  system used to access OS (they define an array of functions copying the imported function addresses ::)).
« Last Edit: January 03, 2013, 07:52:16 PM by frankie »
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Fuzzlix

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #18 on: June 08, 2013, 09:28:40 AM »
Hi.
I have read all posts about sqlite and tried by myself and want to sumarize my experience.
I downloaded the http://www.sqlite.org/2013/sqlite-amalgamation-3071700.zip and compiled w32 and w64 versions for sqlite3.dll and sqlite.exe. (i attached the project files)

w64-dll compiles with compiler optimizaton on

w32-dd errors out with compiler optimizaton on (switching compiler optimizaton off helped.) #pragma optimize(none) was no option for me, because it disabled optimization for w64 too.

I am using the latest PellesC/64 (pocc v7.00.25). So frankie is using a newer version (7.00.355) ?
Where can i get this version?

Thanks.
Fuzzlix.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Can't compile SQLite -- "internal error"
« Reply #19 on: June 09, 2013, 12:48:36 PM »
The last version is the "refreshed" version you'll find it here
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Fuzzlix

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #20 on: June 09, 2013, 12:57:21 PM »
The last version is the "refreshed" version you'll find it here
Thank you Frankie. My Mistake. I have the PellesC V7.00.355 installed already. (downloaded 1 month ago) I told you the version number of POCC like listed in the about box.

Anyway i cant compile w32-dll with activated compiler optimization. (w64 works well)

No need to follow up on this. I just want to let you know. :)

Fuzzlix.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Can't compile SQLite -- "internal error"
« Reply #21 on: June 09, 2013, 01:13:01 PM »
Are you sure?
About box must show 7.00.355
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Fuzzlix

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #22 on: June 09, 2013, 01:15:07 PM »
Are you sure?
About box must show 7.00.355
Yes: PellesC V 7.00.355 (topmost in the about window)
below in the component list box: POCC.EXE: Version 7.00.25

jiake

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #23 on: November 19, 2014, 07:18:22 AM »
Compiling the latest sources for sqlite --

fatal error: Internal error: get_rule_number()
I use Pelles C 6.x and it works, so I intalled two version.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Can't compile SQLite -- "internal error"
« Reply #24 on: November 19, 2014, 10:54:40 AM »
Upgrade to V8.00 RC6
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide