SQLite Forum

Using sqlite3_load_extension on windows
Can anyone tell me where I'm going wrong here? I'm using C++ bulder 10.2 (clang compiler). From IDE menu I've selected File|New|Dynamic Link Library and chosen compile as C with no dependencies. I've then added sqliteFcts.c and made the sqliteFcts.dll library. It all compiles fine.

Contents of sqliteFcts.c.
#include <sqlite3ext.h>


#ifdef _WIN32

int sqlite3_sqliteFcts_init(
  sqlite3 *db,
  char **pzErrMsg,
  const sqlite3_api_routines *pApi
  int rc = SQLITE_OK;

  return rc;

// SQLite code is above. Code below was created by the IDE
// Commenting out the code below still gives the same error message
#pragma argsused
int _libmain(unsigned long reason)
  return 1;

From my own app I try to use the dll with the following code

int rc;
// sets rc=1
// rc==1 and buf contains "The specified procedure cannot be found\r\n"