LETODB

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium

Re: LETODB

Post by t57042 »

hbc files are "configuration" files for use by hbmk2 and this is output of
That is probably the problem.
I don't use hbmk2 (don't even know it)
I use the provided build.bat file that comes with each version of HMG to compile my programs.
How can I include the lib this way?

Richard
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: LETODB

Post by esgici »

t57042 wrote: I don't use hbmk2 (don't even know it)
I use the provided build.bat file that comes with each version of HMG to compile my programs.
How can I include the lib this way?
No directly you, but build.bat uses it (at line 102).

So you can add libs to your project by adding your lib to .hbc file as explained early.

Rgards
Viva INTERNATIONAL HMG :D
t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium

Re: LETODB

Post by t57042 »

Ok, let's summerize what we have so far:

At the server side we have letodb.exe
There is a program manage.exe to check the server.
This works, the server is running and the clients can connect.

From the client side one has to 'link' rddleto.lib with the application.
For HMG that must be librddleto.a

I have a program (see previous post) called letotest.prg
I have a file called letotest.hbc containing 1 line: libs = rddleto (I already tried libs = librddleto - same result)

When compiling this I get:

Code: Select all

Harbour 3.1.0dev (Rev. 17406)
Copyright (c) 1999-2012, http://harbour-project.org/
C:/Users/Richard/AppData/Local/Temp/hbmk_v3iln1.dir/letotest.o:letotest.c:(.data+0x28): undefined reference to `HB_FUN_LETO_CONNECT'
C:/Users/Richard/AppData/Local/Temp/hbmk_v3iln1.dir/letotest.o:letotest.c:(.data+0x168): undefined reference to `HB_FUN_LETO'
collect2: ld returned 1 exit status
hbmk2: Error: Running linker. 1
gcc.exe C:/Users/Richard/AppData/Local/Temp/hbmk_v3iln1.dir/letotest.o C:/Users/Richard/AppData/Local/Temp/hbmk_v3iln1.dir/hbmk_oeigz4.o C:/letodb/_temp.o    -mwindows -Wl,--start-group -lhmg -lcrypt -ledit -leditex -lgraph -lhfcl -lini -lreport -lmsvfw32 -lvfw32 -lhbct -lhbwin -lhbmzip -lminizip -lhbmemio -lhbmisc -lhbmysql -lmysql -lhbtip -lsqlite3 -lhbsqlit3 -lsddodbc -lrddsql -lsddmy -lhbodbc -lodbc32 -lhbhpdf -lhbfimage -lhbpgsql -lhbnetio -lxhb -lhbextern -lhbdebug -lhbvm -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainwin -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib   -Wl,--end-group -oletotest.exe  -LC:/hmg.3.0.41/harbour/lib/win/mingw -LC:/hmg.3.0.41/harbour/bin -LC:/hmg.3.0.41/lib
So I think the lib is not linked. Why not?

regards
Richard
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: LETODB

Post by esgici »

t57042 wrote: So I think the lib is not linked. Why not?
You may not be changed only renamed lib file extension .lib to .a

So as stated earlier, let's wait experts
Viva INTERNATIONAL HMG :D
t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium

Re: LETODB

Post by t57042 »

I did not change the extension from .lib to .a
It is a different lib, provided with the official download.

Richard
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: LETODB

Post by esgici »

t57042 wrote:I did not change the extension from .lib to .a
It is a different lib, provided with the official download.
Remove intervening spaces from .hbc line(s) :

libs = rddleto // wrong
libs=rddleto // correct

Sorry; me too, learned just now ;)
Viva INTERNATIONAL HMG :D
t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium

Re: LETODB

Post by t57042 »

Sorry, but doesn't change anything
Richard
klauskugel
Posts: 90
Joined: Tue Oct 09, 2012 2:28 pm

Re: LETODB

Post by klauskugel »

Hi, I tried it this way.
After playing some time around.
I just need to get used to it. But it looks good.
Hope it helps somewhat.

Greetings from cold Germany
klauskugel

My steps to start with letodb

1. Create c:\leto then Unpack 7zip-file into c:\leto

2. Copy Header-Files .H and .CH from c:\leto\include into c:\hmg.3.1.1\harbour\include
Copy c:\leto\lib\win\mingw\libletodb.a into c:\hmg.3.1.1\harbour\lib\win\mingw

3. check c:\leto\rddleto.hbc,
get line libs=rddleto
and add it after libs=hbvpdf in c:\hmg.3.1.1\hmg.hbc

store file
//---------
letodb.ini

Port = 2812
DataPath =c:\leto\temp
Logfile = "letodb.log"
Default_Driver = CDX
//-----------
in
c:\leto\bin\win\mingw



Use Windows-Shell with CMD.EXE

Change to c:\leto\tests

and type c:\hmg.3.1.1\build mytest //modified test_ta

->Program builds and shows Err-Message without running leto-server.

If Server runs DBF-File is created.

Now start letodb in CMD.EXe shell and

type c:\leto\bin\win\mingw\letodb.exe to start LetoDB-Server

type c:\leto\bin\win\mingw\manage.exe to show Server-Status

manage.exe user admin password xxx

mytest.prg
Function Main
Local cPath := "//127.0.0.1:2812/" // same as in INI-File DataPath =c:\leto\temp

REQUEST LETO
RDDSETDEFAULT( "LETO" )

? "Start"
dbCreate( cPath+"mytest", { {"NORD","N",10,0},{"DORD","C",8,0},{"SUMMA","N",12,0},{"NORM","c",10,0} } )

? "File has been created"

select 5
use ( cPath+"mytest" )
append blank
replace NORD with 555
replace DORD with "test"
? "Record has been added"
index on NORD to mytest

msginfo( DORD ) // Yes it uses HMG

? "End"
?

Return Nil
t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium

Re: LETODB

Post by t57042 »

Hello Klaus,

Where did you download dbleto package?

I did what you explain, and I am able to compile the mytest.prg.
Bur I cannot start the server!!

Greetings from cold Belgium

Richard
klauskugel
Posts: 90
Joined: Tue Oct 09, 2012 2:28 pm

Re: LETODB

Post by klauskugel »

Hi t57042,
i just downloaded the actual version via sourceforge.net

http://heanet.dl.sourceforge.net/projec ... .09-win.7z

Try it here. ;)
You may select other servers on www.sf.net
and there is a lot more software.

there are 3 folders in the LETO\BIN\WIN\ subdir bcc, mingw, mingw64
1st is Borland C 5.5
2nd is HMG/Harbour 32-bit version
3nd is Harbour 64-bit version

Take the 2nd version of letodb.exe,console.exe,manage.exe

The rest is testing if is suits your purpose.

But keep in mind, to ensure locking in Multi-User Environment.
And that 127.0.0.1 is the simple localhost, which is to be replaced
with the IP of the FileServer.
The Port-Adress 2812 still is the same on a real server.

The good thing is, that one dumb user cannot make endless
trouble if he is careless.

Another exiting TCP-Approach is the NetIO example in HMG-Version.

Have fun.
Greetings from Germany,klauskugel
Post Reply