Pelles C forum

Pelles C => Bug reports => Topic started by: jassing on January 02, 2013, 10:23:18 PM

Title: Can't compile SQLite -- "internal error"
Post by: jassing on January 02, 2013, 10:23:18 PM
Compiling the latest sources for sqlite --

fatal error: Internal error: get_rule_number()
Title: Re: Can't compile SQLite -- "internal error"
Post by: Bitbeisser on January 02, 2013, 10:47:38 PM
Quote from: jassing on January 02, 2013, 10:23:18 PM
Compiling the latest sources for sqlite --

fatal error: Internal error: get_rule_number()
Not really much to go by in order to verify/confirm/dismiss/do anything...  :-\

Ralf
Title: Re: Can't compile SQLite -- "internal error"
Post by: jassing on January 02, 2013, 10:55:03 PM
What else would be needed? that's the error the compiler spits out...
There is no "get_rule_number" in sqlite...
Title: Re: Can't compile SQLite -- "internal error"
Post by: Bitbeisser on January 02, 2013, 11:00:34 PM
Quote from: jassing on January 02, 2013, 10:55:03 PM
What else would be needed? that's the error the compiler spits out...
There is no "get_rule_number" in sqlite...
Your project settings at the very least...

I think there's a link to a previously compiled SQlite lib somewhere here on the forum, so I do not think that it is completely impossible to compile it for Pelle's C. More likely that you didn't get all project settings right which leads to this error, trying to compile a piece that it can't digest...

Also a link to exactly which sources you are trying to compile and what you changed would be helpful as well...

Ralf
Title: Re: Can't compile SQLite -- "internal error"
Post by: jassing on January 02, 2013, 11:18:51 PM
I used the latest sources from sqlite.org "amalgamation"
http://sqlite.org/sqlite-amalgamation-3071501.zip

I created a project as (one/either) a DLL or static-lib. Added sqlite3.c and sqlite3.def files to the project.
I hit build.
From there, I tried changing various settings, mostly changing settings from the default settings just meant more errors; but changin the code from there to deal with the errors, all ultimately lead to the "fatal internal error"
Title: Re: Can't compile SQLite -- "internal error"
Post by: CommonTater on January 03, 2013, 12:12:08 AM
I just downloaded the ZIP you linked in your message....

It built as a 32 bit static library on Pelles C 7 x64 ...
But it was not without a lot of warnings...

Building sqlite3.obj. Use <stdlib.h> instead of non-standard <malloc.h>
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(20969): warning #2154: Unreachable code.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(20962): warning #2154: Unreachable code.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(20970): warning #2154: Unreachable code.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(20968): warning #2154: Unreachable code.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(21425): warning #2071: Overflow in constant expression.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'AreFileApisANSI' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'CloseHandle' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'CreateFileA' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'CreateFileW' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'CreateFileMappingA' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'CreateFileMappingW' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'CreateMutexW' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'DeleteFileA' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'DeleteFileW' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'FlushFileBuffers' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'FormatMessageA' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'FormatMessageW' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'FreeLibrary' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetCurrentProcessId' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetDiskFreeSpaceA' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetDiskFreeSpaceW' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetFileAttributesA' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetFileAttributesW' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetFileAttributesExW' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetFileSize' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetFullPathNameA' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetFullPathNameW' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetLastError' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetProcAddress' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetSystemInfo' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetSystemTime' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetSystemTimeAsFileTime' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetTempPathA' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetTempPathW' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetTickCount' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetVersionExA' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'HeapAlloc' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'HeapCreate' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'HeapDestroy' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'HeapFree' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'HeapReAlloc' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'HeapSize' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'HeapValidate' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'LoadLibraryA' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'LoadLibraryW' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'LocalFree' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'LockFile' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'LockFileEx' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'MapViewOfFile' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'MultiByteToWideChar' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'QueryPerformanceCounter' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'ReadFile' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'SetEndOfFile' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'SetFilePointer' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'Sleep' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'SystemTimeToFileTime' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'UnlockFile' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'UnlockFileEx' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'UnmapViewOfFile' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'WideCharToMultiByte' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'WriteFile' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'WaitForSingleObject' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'OutputDebugStringA' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'OutputDebugStringW' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(31001): warning #2214: Address of import 'GetProcessHeap' is not static, identity not guaranteed.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(43010): warning #2154: Unreachable code.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(43011): warning #2154: Unreachable code.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(43012): warning #2154: Unreachable code.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(43013): warning #2154: Unreachable code.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(43015): warning #2154: Unreachable code.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(43016): warning #2154: Unreachable code.
D:\Coding\sqlite-amalgamation-3071501\sqlite-amalgamation-3071501\sqlite3.c(8153): warning #2135: Static 'sqlite3one' is not referenced.
  Building sqlite.lib.
Done.


Thing is, you need to deal with the warnings as though they're errors...
Moreover, Pelles C does not "smart link" so having all your functions in one giant source code means that whole thing is going to be linked into whatever executable you are creating.  You might be better to find the standard multi-source version and try compiling it.

In any event... this is not a bug in Pelles C.

Title: Re: Can't compile SQLite -- "internal error"
Post by: jassing on January 03, 2013, 12:15:46 AM
So the fact that I get an error "internal error" is standard for pelles ?  yikes; thanks...
Title: Re: Can't compile SQLite -- "internal error"
Post by: CommonTater on January 03, 2013, 12:20:32 AM
Quote from: jassing on January 03, 2013, 12:15:46 AM
So the fact that I get an error "internal error" is standard for pelles ?  yikes; thanks...

All errors are internal ... They're not happening in Oshkosh, are they? :D
The matter that it reported it without crashing tells me it worked as it should.

Beside that... it built for me first try.


Title: Re: Can't compile SQLite -- "internal error"
Post by: Bitbeisser on January 03, 2013, 12:25:47 AM
Quote from: jassing on January 03, 2013, 12:15:46 AM
So the fact that I get an error "internal error" is standard for pelles ?  yikes; thanks...
No, that is the wrong conclusion.
Something in your project settings is causing the compiler to "wander off". I haven't tried it myself yet (as I am working on making a living today again), but as Tater already mentioned, it compiles/builds for him without an "internal error".
What you need to realize is that SQLite and it's source is extremely "cross-platform", intended for a lot of different host environments. One wrong setting and you could unintentionally try to process a piece of code that isn't intended to work on Windows or x86 architecture, just as an example...

Just had only a quick look at your project file/settings and it seems that creating a multi-threaded library is causing the internal error, it doesn't show up when trying to create a static library as Tater also tried to create.
It might take a bit digging through at least the first thousand or so lines to check on all the defines to see what might need to be adjusted...

Ralf
Title: Re: Can't compile SQLite -- "internal error"
Post by: jassing on January 03, 2013, 12:59:21 AM
I've tried both not-multithreaded and multithreaded, both fail.
He's building x64 os, I'm building 32bit os -- maybe there's an issue.
I have tried on win7 (x64, but using pelles x86), WinXP, and Win2003 -- all resulted (using "bone stock settings") in an "internal error" 

I'll try to download an older pelles compiler, because I used to compile it w/o issue (treating warnings as warnings)  but the latest does not seem to cooperate.

Thanks for the info/help.

Cheers
-j
Title: Re: Can't compile SQLite -- "internal error"
Post by: Bitbeisser on January 03, 2013, 01:19:06 AM
Quote from: jassing on January 03, 2013, 12:59:21 AM
I've tried both not-multithreaded and multithreaded, both fail.
He's building x64 os, I'm building 32bit os -- maybe there's an issue.
Nope, I did my quick test on  Windows XPSP3 32bit, with the same result as Tater...
QuoteI have tried on win7 (x64, but using pelles x86), WinXP, and Win2003 -- all resulted (using "bone stock settings") in an "internal error" 

I'll try to download an older pelles compiler, because I used to compile it w/o issue (treating warnings as warnings)  but the latest does not seem to cooperate.
Did you take a look at the very other threads about compiling SQLite with Pelle's C in the forum yet?

Ralf
Title: Re: Can't compile SQLite -- "internal error"
Post by: CommonTater on January 03, 2013, 01:20:15 AM
Quote from: jassing on January 03, 2013, 12:59:21 AM
I've tried both not-multithreaded and multithreaded, both fail.
He's building x64 os, I'm building 32bit os -- maybe there's an issue.
I have tried on win7 (x64, but using pelles x86), WinXP, and Win2003 -- all resulted (using "bone stock settings") in an "internal error" 

Turn off optimizations, set inlining to default, use single threaded library....
It worked for me, first time.
Title: Re: Can't compile SQLite -- "internal error"
Post by: jassing on January 03, 2013, 01:38:21 AM
awesome. the "works for me" is always appreciated...

I could create a video of me going thru the steps of :
load poide
create a new project in a new folder
add source files
check teh settings (to be as you specified)
hit build
"internal error"
but the end would still be "well, it works for me" (the other side of that coin is: 3 machines, 3 failures)
Thanks. I'll try to find an old download of pelles rather than try to get the most recent working for me...

maybe it is, as one post suggested, I need to treat all warnings as errors -- and fix any warnings it pops up (like "unreferenced" or "unreachable")    anyway, seems pointless, since you said it worked "as is" for you...
thanks.   I'm giving up for sqlite+pelles7.
Title: Re: Can't compile SQLite -- "internal error"
Post by: CommonTater on January 03, 2013, 02:48:24 AM
Quote from: jassing on January 03, 2013, 01:38:21 AM
but the end would still be "well, it works for me" (the other side of that coin is: 3 machines, 3 failures)
Thanks. I'll try to find an old download of pelles rather than try to get the most recent working for me...

1) Before you go looking for old versions... install the Workspace Manager AddIn from... HERE (http://forum.pellesc.de/index.php?topic=5095.msg19474#msg19474) and use that for your new project.  The default settings are a little more flexible than the defaults through the regular wizard.

2) If you're really bent on blaming the current version, you can get older versions from ... HERE (http://www.pellesc.de/index.php?page=download&lang=en)  ... going all the way back to version 2.8.

I didn't say it was perfect ... there were a LOT of warnings as I showed you.  Some of them make me think that it's intended to compile as a DLL not a library... But there's nothing there telling me this is a bug in Pelles C... more likely it's something simple... like do you have "Microsoft Extensions" checked in the compiler tab? 

Here... I'm attaching the ppj files for you to look at and a screen cap showing the built LIB and DLL...

The only other reason I can think of is that it's running out of memory with that huge source file... There is a setting in the registry (HKLM\Software\Pelle Orinius\PellesC\Application) for maximum file size... perhaps increasing that will help.

Title: Re: Can't compile SQLite -- "internal error"
Post by: Bitbeisser on January 03, 2013, 03:27:03 AM
Quote from: CommonTater on January 03, 2013, 02:48:24 AM
I didn't say it was perfect ... there were a LOT of warnings as I showed you.  Some of them make me think that it's intended to compile as a DLL not a library... But there's nothing there telling me this is a bug in Pelles C... more likely it's something simple... like do you have "Microsoft Extensions" checked in the compiler tab? 
Well, that's something that I check on first when I did my quick test earlier today, it compiles with a lot of errors warnings but no "internal error"...
QuoteHere... I'm attaching the ppj files for you to look at and a screen cap showing the built LIB and DLL...

The only other reason I can think of is that it's running out of memory with that huge source file... There is a setting in the registry (HKLM\Software\Pelle Orinius\PellesC\Application) for maximum file size... perhaps increasing that will help.
I did my tests on an XP 32bit machine, and just re-did it quickly with the task manager open. POIDE and POCC/LOKINK together never exceeded 100MB of RAM, on a machine that has 3.5GB (4GB- some slack due to the Dell BIOS) and 1.2GB free (a lot of other programs, like this browser window open at the same time), so I do not think that this is a problem here...

Attached is my project file for the same unmodified source from the original source link.

Ralf
Title: Re: Can't compile SQLite -- "internal error"
Post by: frankie 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....
Title: Re: Can't compile SQLite -- "internal error"
Post by: TimoVJL 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
> 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"
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]
Title: Re: Can't compile SQLite -- "internal error"
Post by: frankie 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 ::)).
Title: Re: Can't compile SQLite -- "internal error"
Post by: Fuzzlix 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 (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.
Title: Re: Can't compile SQLite -- "internal error"
Post by: frankie on June 09, 2013, 12:48:36 PM
The last version is the "refreshed" version you'll find it here (http://forum.pellesc.de/index.php?topic=4776.0)
Title: Re: Can't compile SQLite -- "internal error"
Post by: Fuzzlix on June 09, 2013, 12:57:21 PM
Quote from: frankie on June 09, 2013, 12:48:36 PM
The last version is the "refreshed" version you'll find it here (http://forum.pellesc.de/index.php?topic=4776.0)
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.
Title: Re: Can't compile SQLite -- "internal error"
Post by: frankie on June 09, 2013, 01:13:01 PM
Are you sure?
About box must show 7.00.355
Title: Re: Can't compile SQLite -- "internal error"
Post by: Fuzzlix on June 09, 2013, 01:15:07 PM
Quote from: frankie on June 09, 2013, 01:13:01 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
Title: Re: Can't compile SQLite -- "internal error"
Post by: jiake on November 19, 2014, 07:18:22 AM
Quote from: jassing on January 02, 2013, 10:23:18 PM
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.
Title: Re: Can't compile SQLite -- "internal error"
Post by: frankie on November 19, 2014, 10:54:40 AM
Upgrade to V8.00 RC6