I tried following:
Code: Select all
sqlite3DLL = OpenLibrary(0, "/usr/lib/libsqlite3.dylib")
If sqlite3DLL
Debug "Lib reachable"
sqlite3_libversion = IsFunction(sqlite3DLL, "sqlite3_libversion")
If sqlite3_libversion = 0
Debug "no function 'libversion'"
Else
Debug "function 'libversion' reachable"
EndIf
sqlite3_open = IsFunction(sqlite3DLL, "sqlite3_open")
If sqlite3_open
;hResult = CallCFunctionFast(*sqlite3_open, "Test.db", @sqlite3_dbHandle)
EndIf
EndIf
I can access to the lib. No error. But Purebasic cannot access the function "sqlite3_libversion". The variable returns always a zero. If I look into the header-file of the lib (/usr/includes/sqlite3.h), I can see that this function should exist:
Code: Select all
/*
** The version string is also compiled into the library so that a program
** can check to make sure that the lib*.a file and the *.h file are from
** the same version. The sqlite3_libversion() function returns a pointer
** to the sqlite3_version variable - useful in DLLs which cannot access
** global variables.
*/
extern const char sqlite3_version[];
const char *sqlite3_libversion(void);
/*
** Return the value of the SQLITE_VERSION_NUMBER macro when the
** library was compiled.
*/
int sqlite3_libversion_number(void);
/*
** Each open sqlite database is represented by an instance of the
** following opaque structure.
*/
typedef struct sqlite3 sqlite3;
Any idea out there?
The sqlite3 terminal application works well on Mac. You can admin, create, read, edit databases and tables. Its looks like only a short way to get the Sqlite workable with PB on Mac...