Trying to use a package lazarus / 21-General ---------------------------------------------------------------------- Graham Saint · 2023-05-18 10:03 I went to the sqlite4pc website (https://sqlite4fpc.yolasite.com/) and downloaded three units there. I then used those three units to build a package (sqlite4fpc.lpk). I did not not install the package to the IDE but added it to my project. But a unit using this package won't compile. The unit has "USES sqlite4fpc" but the line VAR ds : TSqlite3Dataset;  gives a compiler error "Identifier not found TSqlite3Dataset" although this is clearly defined in the interface section of one of the units making up the package. TSqlite3Dataset = class(TCustomSqliteDataset) I'm more than a bit lost here. The compiler is happy to accept "USES sqlite4fpc;" so presumably the package itself is okay. Thanks in advance. Graham ---------------------------------------------------------------------- TRon · 2023-05-18 10:08 Hello Graham, My question is a simple one: why ? from that website: QuoteSince 2004 the TDataset descendant is included in the Freepascal distribution. ---------------------------------------------------------------------- superc · 2023-05-18 14:27 Quote from: Graham Saint on May 18, 2023, 12:03:51 pmI went to the sqlite4pc website (https://sqlite4fpc.yolasite.com/) and downloaded three units there. I then used those three units to build a package (sqlite4fpc.lpk). I did not not install the package to the IDE but added it to my project. But a unit using this package won't compile. The unit has "USES sqlite4fpc" but the line VAR ds : TSqlite3Dataset;  gives a compiler error "Identifier not found TSqlite3Dataset" although this is clearly defined in the interface section of one of the units making up the package. TSqlite3Dataset = class(TCustomSqliteDataset) I'm more than a bit lost here. The compiler is happy to accept "USES sqlite4fpc;" so presumably the package itself is okay. Thanks in advance. Graham Sorry for the question, but ultimately what is your purpose? connect to a sqlite db? ---------------------------------------------------------------------- wp · 2023-05-18 14:37 If I understand correctly you created a package, sqlite4fpc.lpk, and added the three units of the site cited to it? The first thing for you is then to open this package in the ide (Package > Open package file) and to compile it. If it does not compile you must fix the compilation issue. Then you should create a simple project in which you create the classes exported by the package at runtime and test whether they work correctly. In this project, you must add the sqlite4fpc package to the "requirements" (Project > Project Options > Add > New Requirement > Select sqlite4fpc from the list > OK, so that the package appears in the tree under "required packages"). In the unit in which you call units of the package add the corresponding units to the "uses" clause (adding the package unit sqlite4fpc is not needed and won't give you access to the units). ---------------------------------------------------------------------- Graham Saint · 2023-05-19 01:02 Hi, Yes, I'm trying to use sqlite databases. I'm having trouble using the supplied components so after searching the forums it looked like sqlite4pc was worth investigation. If it proved successful I'd probably use them in a number of applications. More forum browsing indicated that creating a package was the best way to share common units. I thought I'd done everything required but wp advised adding the individual units to the uses clause. I did that and the program now compiles. I had the impression that it was only necessary to specify the package in the uses clause. So, thank you everyone. We can close this. ---------------------------------------------------------------------- wp · 2023-05-19 15:31 As already noted by TRon, it looks that these units are already distributed along with Lazarus/fpc. So, when you go to "Package" > "Install/Uninstall packages", select sqlite3laz in the right list and click "Install selection" and "Save and rebuild IDE" you get the same units. There is a problem, though: When this package is installed the IDE requires that the sqlite3.dll can be found. Otherwise the IDE won't start any more! Don't forget this when you move to a different PC. Normally I use SQLDB which even is installed by default. Here the sqlite3.dll is only required by your application at runtime. see https://wiki.freepascal.org/SQLite#Using_the_SQLdb_components_with _SQLite