Undefined function: sqlite3_open

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

Undefined function: sqlite3_open

Post by karweru »

Hi Friends,

I'm encountering the error above when my program executes the this line:

do("sqlite3_open", "accounts.db",.t.)
The purpose of calling sqlite3_open() this way is because i need to use NetIo RPC so that I can work on an sqlite database located on a remote pc.

I would greatly appreciate any help.
Kind regards,
Gilbert.
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Undefined function: sqlite3_open

Post by Rathinagiri »

It is working for me fine. What could be the problem then? Any file permission issues?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

Re: Undefined function: sqlite3_open

Post by karweru »

Hi Rathi,

Thanks for your time and effort. I'm also confused. When i run the following sample

#include 'minigui.ch'
#include 'hbclass.ch'

FUNCTION MAIN()

DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 200 ;
TITLE 'RPC Test' ;
MAIN

DEFINE MAIN MENU
POPUP 'Test'
ITEM 'TEST RPC (1)' ACTION {||do("sqlite3_open","orgs.db",.t.)}
ITEM 'TEST RPC (2)' ACTION {||sqlite3_open("orgs.db",.t.)}
END POPUP
END MENU

END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
It runs without a problem, which means also I don't have access rights issues.
However, when i remark out the line
ITEM 'TEST RPC (2)' ACTION {||sqlite3_open("orgs.db",.t.)}
the undefined function : sqlite3_open error comes up.

I would appreciate any insights you might have. Thank you so much again for your time.
Kind regards,
Gilbert.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Undefined function: sqlite3_open

Post by sudip »

Hello Gilbert,

I also don't have any problem with that function. Following code is working fine.

Code: Select all

   mRootDb := sqlite3_open(cRootDatabase, .t.)
   if mRootDb == nil
   	msgbox("Cannot Open/Create "+cRootDatabase)
   	return nil
   endif
Which version of HMG are you using?

I am using HMG 3.0.35. With HMG IDE, I don't need to add Sqlite library. You may also try with adding the library libhbsqlit3.a, from \HMG\HARBOUR\LIB

Thanks.
With best regards,
Sudip
User avatar
karweru
Posts: 220
Joined: Fri Aug 01, 2008 1:51 pm
DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
Contact:

Re: Undefined function: sqlite3_open

Post by karweru »

Hi Sudip,

Thanks for your response. I'm actually lost as to what the problem could be. I'm using the HMG version 3.0.35 (2010.06.20). I've 'resolved' the problem by including the dummy function below, which, though not called from anywhere in my program, seems to take out the problem.
FUNCTION force_sqlite_link()
sqlite3_open()
sqlite3_exec()
sqlite3_get_table()
sqlite3_prepare()
sqlite3_column_count()
sqlite3_column_decltype()
sqlite3_reset()
sqlite3_column_name()
sqlite3_errmsg()
sqlite3_errcode()
return
I've offloaded all minigui installations and even harbour and re-installed but to no avail. At this point, I have to believe the problem is with my environment, due to the fact that you and Rathi can't replicate the problem.

However, I'm grateful for your support.
Kind regards,
Gilbert.
Post Reply