NO

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

jassing

  • Guest
Can't compile SQLite -- "internal error"
« on: January 02, 2013, 10:23:18 PM »
Compiling the latest sources for sqlite --

fatal error: Internal error: get_rule_number()

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Can't compile SQLite -- "internal error"
« Reply #1 on: January 02, 2013, 10:47:38 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

jassing

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #2 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...

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Can't compile SQLite -- "internal error"
« Reply #3 on: January 02, 2013, 11:00:34 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

jassing

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #4 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"

CommonTater

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #5 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...

Code: [Select]
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.

 

jassing

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #6 on: January 03, 2013, 12:15:46 AM »
So the fact that I get an error "internal error" is standard for pelles ?  yikes; thanks...

CommonTater

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #7 on: January 03, 2013, 12:20:32 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.


« Last Edit: January 03, 2013, 12:24:15 AM by CommonTater »

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Can't compile SQLite -- "internal error"
« Reply #8 on: January 03, 2013, 12:25:47 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
« Last Edit: January 03, 2013, 12:40:41 AM by Bitbeisser »

jassing

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #9 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

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Can't compile SQLite -- "internal error"
« Reply #10 on: January 03, 2013, 01:19:06 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...
Quote
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.
Did you take a look at the very other threads about compiling SQLite with Pelle's C in the forum yet?

Ralf

CommonTater

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #11 on: January 03, 2013, 01:20:15 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.

jassing

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #12 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.
« Last Edit: January 03, 2013, 01:41:31 AM by jassing »

CommonTater

  • Guest
Re: Can't compile SQLite -- "internal error"
« Reply #13 on: January 03, 2013, 02:48:24 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 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  ... 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.

 
« Last Edit: January 03, 2013, 03:09:05 AM by CommonTater »

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: Can't compile SQLite -- "internal error"
« Reply #14 on: January 03, 2013, 03:27:03 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"...
Quote
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.
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