SqliteTable3.pas doesn't compile (Win32, D10Seattle Enterprise)

Issue #155 closed
Daniele Teti created an issue

There are some compilation problems (at least in my machine) with unit SQLiteTable3.pas. Try to include it in your project as following...

program Project1;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  SqliteTable3;

begin
  try
    { TODO -oUser -cConsole Main : Insert code here }
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.

...and you will get the followings:

[dcc32 Error] SQLiteTable3.pas(169): E2003 Undeclared identifier: 'TSQLiteActionCode'
[dcc32 Error] SQLiteTable3.pas(171): E2005 'TSQLiteActionCode' is not a type identifier

This is because the following conditionals are defined early in the same unit

{$IFNDEF MSWINDOWS}
  {$DEFINE USE_SYSTEM_SQLITE}
{$ENDIF}

//then some lines after
{$IFDEF USE_SYSTEM_SQLITE}
type
  TSQLiteActionCode = type Integer;

I'd like to use Firebird and SQLite in my test project, however, I had to remove the SqliteTable3 unit in my uses list to compile it. However, removing the IFDEF (so that the USE_SYSTEM_SQLITE is always defined) seems to work.

Comments (7)

  1. Stefan Glienke repo owner

    I cannot reproduce. On Win32 it should not define USE_SYSTEM_SQLITE but even if I manually set that define it compiles just fine.

    However, removing the IFDEF (so that the USE_SYSTEM_SQLITE is always defined) seems to work.

    If you remove the IFDEF then USE_SYSTEM_SQLITE is not defined.

  2. Daniele Teti reporter

    To let the unit compiles I've to change this

    {$IFNDEF MSWINDOWS}
      {$DEFINE USE_SYSTEM_SQLITE}
    {$ENDIF}
    

    in this

    {.$IFNDEF MSWINDOWS}
      {$DEFINE USE_SYSTEM_SQLITE}
    {.$ENDIF}
    

    so, in other words, I've to define USE_SYSTEM_SQLITE

  3. Stefan Glienke repo owner

    Make sure you are using the correct SQLite3.pas as well. Because then everything needed is declared.

  4. Daniele Teti reporter

    Just checked. I had another Sqlite3.pas in the path, derived from the same Tim Anderson wrapper. Removing that path, all its ok. Thank you Stefan.

  5. Log in to comment