Lacking error reporting Sqlite? lazarus / 61-Beginners ---------------------------------------------------------------------- Benjiro · 2017-07-08 00:05 Supposed we have a little program under Windows/32 like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program sqlite;{$mode objfpc} uses     sqlite3db, strings, classes; var  DB: TSQLite;  SQL: String;begin    Writeln('Creating class');    DB := TSQLite.Create('test.db');     // .....    DB.Free;  When there is no sqlite3.dll present, you expect a compilation error or the executable to fail. Yet, this compiles correctly with fpc and will execute. But no output is shown ( including no writeln ). It actually eats all errors on the TSQLite.Create, while the exiting the program like nothing had gone wrong. Making it look like the program runs but it becomes unclear as to what the real issue is... Technically this is very old code but its still included in the example section of FPC. And even worse the DB variable was called MySQL, when it was using Sqlite. Copy and past job without replacing the variables. ---------------------------------------------------------------------- taazz · 2017-07-08 11:50 are you sure its the tsqlite that creates the problem and not the writeln? Have you checked the project's options to make sure that the win32 GUI option is not set? IF it is set then there is no console to writeln to. ---------------------------------------------------------------------- Benjiro · 2017-07-08 12:07 Quote from: taazz on July 08, 2017, 01:50:18 pmare you sure its the tsqlite that creates the problem and not the writeln? Have you checked the project's options to make sure that the win32 GUI option is not set? IF it is set then there is no console to writeln to. Its run under Visual Studio Code with pure command line Fpc compilation. I have other pieces of code, where this is not a issue. Forcing it to use -WC still result in the same lack of output. Your right, running it as a stand alone executable trigger a GUI error, what makes no sense. Fpc sqlite.pas * Console:= No error, no output * Starting exe from file explorer. Console Box + GUI Error Fpc -WC sqlite.pas * Console:= No error, no output * Starting exe from file explorer. Console Box + GUI Error Fpc -WG sqlite.pas * Console:= No error, no output * Starting exe from file explorer. GUI Error For some reason, the sqlite3db TSQLite is triggering a GUI despite being compiled to console. Looks like a bug in sqlite3db... ---------------------------------------------------------------------- taazz · 2017-07-08 12:21 if you place a break point in the first writeln does the debuger stop there before the exception? or it never does? If it never does check the initialization sections of the used units something in there triggers the error. ---------------------------------------------------------------------- Benjiro · 2017-07-08 12:43 Seems to be the dynamic library loading that is the issue. When it initializes, it trigger a GUI error and never runs the actual code. So the writeln never gets shown. So your right, the moment it initialises the Sqlite3(db) unit, it trigger this error. Now is the issue still why a GUI error is triggered. Currently taking a look in the source but still a bit new to Pascal to figure it all out https://svn.freepascal.org/cgi- bin/viewvc.cgi/trunk/packages/sqlite/src/sqlite3.inc?view=markup I am not seeing anything related to the GUI. Unless the fpc unit release has been compiled with -WG / GUI, that can also be the issue...