How to compile this (sqlite sample)
Moderator: Rathinagiri
- Clip2Mania
- Posts: 99
- Joined: Fri Jun 13, 2014 7:16 am
- Location: Belgium
How to compile this (sqlite sample)
Hi all,
I'm trying to compile the example attached (it's about sqlite) in HMG, but I can't get it working.
I keep on getting 'undefined reference to `sqlite3_xxxxx' errors
What should I do to make these errors go away?
Thanks,
Erik
I'm trying to compile the example attached (it's about sqlite) in HMG, but I can't get it working.
I keep on getting 'undefined reference to `sqlite3_xxxxx' errors
What should I do to make these errors go away?
Thanks,
Erik
- Attachments
-
- sqlite.rar
- (41.95 KiB) Downloaded 531 times
Re: How to compile this (sqlite sample)
Hi,
I could able to compile successfully. However there is an argument error which you may need to correct.
C:\hmg.3.3.0\SAMPLES\Projs\sqlite>type build.bat
@echo ON
cls
SETLOCAL
SET temp=%~dp0
SET stemp=%temp%&SET pos=0
:loop
SET /a pos+=1
echo %stemp%|FINDSTR /b /c:"SAMPLES" >NUL
IF ERRORLEVEL 1 (
SET stemp=%stemp:~1%
IF DEFINED stemp GOTO loop
SET pos=0
)
setlocal enableDelayedExpansion
set "temp1=%temp%"
set /a pos=pos-2
set temp=!temp1:~0,%pos%!
if "%1"=="" Goto WithOutPar
Set MainFile=%1
Goto Continue
:WithOutPar
for /R %~dp0%~1 %%f in (*.hbp) do (Set MainFile="%%~nf")
Goto Continue
:Continue
call %temp%\build.bat %MainFile%
I could able to compile successfully. However there is an argument error which you may need to correct.
C:\hmg.3.3.0\SAMPLES\Projs\sqlite>type build.bat
@echo ON
cls
SETLOCAL
SET temp=%~dp0
SET stemp=%temp%&SET pos=0
:loop
SET /a pos+=1
echo %stemp%|FINDSTR /b /c:"SAMPLES" >NUL
IF ERRORLEVEL 1 (
SET stemp=%stemp:~1%
IF DEFINED stemp GOTO loop
SET pos=0
)
setlocal enableDelayedExpansion
set "temp1=%temp%"
set /a pos=pos-2
set temp=!temp1:~0,%pos%!
if "%1"=="" Goto WithOutPar
Set MainFile=%1
Goto Continue
:WithOutPar
for /R %~dp0%~1 %%f in (*.hbp) do (Set MainFile="%%~nf")
Goto Continue
:Continue
call %temp%\build.bat %MainFile%
- Attachments
-
- screen.png (8.82 KiB) Viewed 13797 times
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: How to compile this (sqlite sample)
In your .hbc file, you have to include
libs=sqlite3
libs=sqlite3
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Clip2Mania
- Posts: 99
- Joined: Fri Jun 13, 2014 7:16 am
- Location: Belgium
Re: How to compile this (sqlite sample)
That's what I was missing. Thought it was some lib-thing, but didn't know where to put it!In your .hbc file, you have to include
libs=sqlite3
Thanks, Mr. Rathinagiri!
Erik
Re: How to compile this (sqlite sample)
Add in hmg.hbc file located at c:\hmg\hmg.hbcClip2Mania wrote:That's what I was missing. Thought it was some lib-thing, but didn't know where to put it!In your .hbc file, you have to include
libs=sqlite3
Thanks, Mr. Rathinagiri!
Erik
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
- Clip2Mania
- Posts: 99
- Joined: Fri Jun 13, 2014 7:16 am
- Location: Belgium
Re: How to compile this (sqlite sample)
It happened to be the only lib which was "remmed out" (#) in hmg 3.3.1 (don't know why)Add in hmg.hbc file located at c:\hmg\hmg.hbc
However, I still get following error (apparently cannot create the database)
I am using HMG 3.3.1 - 32 bits.
Should I recompile harbour or so?
- Attachments
-
- sqlite_err.jpg (58.2 KiB) Viewed 13674 times
Re: How to compile this (sqlite sample)
Hi,Clip2Mania wrote: However, I still get following error (apparently cannot create the database)
I am using HMG 3.3.1 - 32 bits.
Should I recompile harbour or so?
No, it is not
There is a mistake in your calling the function MiscSql() - wrong a first parameter.
Please take a look for your updated module main_button_1_action.prg below:
Code: Select all
#include "hmg.ch"
declare window Main
Function main_button_1_action
public dbo := nil
if .not. file("nombre.db3")
crearbase("nombre.db3")
msginfo("BASE Creada")
return nil
else
dbo := connect2db("nombre.db3",.f.)
If dbo == nil
msginfo("no se puede conectar con la Base")
return nil
Endif
endif
if ! iswindowactive(vnombre)
Load Window vnombre
datossqlite()
vnombre.Center
vnombre.Activate
endif
Return Nil
function crearbase(mDb)
local sQry
dbo := connect2db(mDb,.t.)
if dbo == nil
msgstop("File could not be created!")
return nil
endif
// create table
sQry := 'CREATE TABLE IF NOT EXISTS "personales" ("id" INTEGER PRIMARY KEY, "nombre" VARCHAR(55), "telefono" VARCHAR(15), "fecha" DATE);'
MiscSql(dbo, sQry)
return nil
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- mustafa
- Posts: 1162
- Joined: Fri Mar 20, 2009 11:38 am
- DBs Used: DBF
- Location: Alicante - Spain
- Contact:
Re: How to compile this (sqlite sample)
Hello Clip2Mania
Look at the Post:
viewtopic.php?f=6&t=1558&start=10" onclick="window.open(this.href);return false;
Sample_Sqlite.zip
Regards
Mustafa
Look at the Post:
viewtopic.php?f=6&t=1558&start=10" onclick="window.open(this.href);return false;
Sample_Sqlite.zip
Regards
Mustafa
- Clip2Mania
- Posts: 99
- Joined: Fri Jun 13, 2014 7:16 am
- Location: Belgium
Re: How to compile this (sqlite sample)
Thanks Mustafa!
Problem is, I once downloaded this (nice) example, but wasn't aware of the updates
Thanks for helping me out! All works now.
Erik
Problem is, I once downloaded this (nice) example, but wasn't aware of the updates
Thanks for helping me out! All works now.
Erik