unidac SQLite默认使用静态连接方式,但UNIDAC官方SQLite未提供arm64或loongxarch64静态库,造成linux for龙芯或arm64无法使用SQLite,经跟踪unidac源码发现将souce/uniProviders/SQLite/LiteDac.inc添加
{$DEFINE NOSTATIC}
然后安装liteprovider10.lpk就可以。
////////////////////////////////////////////////// // SQLite Data Access Components // Copyright © 2008-2022 Devart. All right reserved. ////////////////////////////////////////////////// {$I Dac.inc} {$DEFINE NOSTATIC} {$DEFINE UNIDACPRO} {$IFNDEF NOSTATIC} {$IFDEF STD} {$IFNDEF LITE} {$DEFINE NOSTATIC} {$ENDIF} {$ENDIF} {$IFDEF FPC} {$IFDEF LINUX} {$DEFINE LINUX_FPC} {$ELSE} {$IFDEF DARWIN} {$DEFINE DARWIN_FPC} {$ENDIF} {$ENDIF} {$ENDIF} {$IFNDEF NOSTATIC} {$IFDEF IOS} {$IFNDEF CPUARM} {$DEFINE NOSTATIC} {$ENDIF} {$ENDIF} {$ENDIF} {$ENDIF}
UniConnection1.Connected:=false; UniConnection1.ConnectString:='Provider Name=SQLite;'+ 'Database='+ExtractFilePath(Application.ExeName)+'demo.db3;'+ 'Client Library='+ExtractFilePath(Application.ExeName)+'libsqlite3.so'; UniTable1.TableName:='hardware'; UniTable1.Open;
标签:SQLite,IFDEF,linux,NOSTATIC,arm64,ENDIF,unidac,DEFINE From: https://www.cnblogs.com/qiufeng2014/p/17301010.html