TDolphin - linking problems ...

TDolphin - linking problems ...

Postby Rimantas » Wed Mar 06, 2013 2:01 pm

Hi,
Thought I sucesed linked samples in Dolphin\samples , can't to create own project . Diff. here that dolphin use win-make utility , I'm using hbmk2 and .hbp . Sorry , but I'm not a good expert of hbmk2 or win-make . What I must to do for that project ?

.hbp ( 1-st version )

Code: Select all  Expand view

-inc
-incpath=\a\fwh\include
-incpath=\a\hrbg\include
-incpath=\a\fwh\lib

-L\a\fwh\lib
-lfivehg
-lfivehgc
-ldolphin
-lgtgui
-luser32
-lwinspool
-lkernel32
-lcomctl32
-lcomdlg32
-lgdi32
-lole32
-loleaut32
-lpsapi
-loledlg
-lmfcuia32
-lmsimg32
-lwin32k
-lstdc++
-lversion
-luuid
-lwinmm
-lvfw32
-lwsock32
-lhbcommon
-lhbcpage
-lhbcplr
-lhbct
-lhbhsx
-lhblang
-lhbmacro
-lhbmainstd
-lhbmzip
-lodbc32
-lsddodbc
-lrddsql
-lhbpcre
-lhbpp
-lhbrdd
-lhbrtl
-lhbsix
-lhbmysql
-lhbtip
-lhbusrrdd
-lhbvm
-lhbwin
-lhbzlib
-lrddcdx
-lrddfpt
-lrddntx
-lxhb
-lpng

-oengel.exe
-icon=engel.ico

-gui
-w3 -es0

engel.prg
func.prg
func_brw.prg
func_dsg.prg
func_dt.prg
uzs.prg
engel.rc
 


2-nd version :
Code: Select all  Expand view

-inc
-incpath=\a\fwh\include
-incpath=\a\hrbg\include
-incpath=\a\fwh\lib

-ldolphin
-L\a\fwh\lib
-lfivehg
-lfivehgc

-oengel.exe
-icon=engel.ico

-gui
-w3 -es0

engel.prg
func.prg
func_brw.prg
func_dsg.prg
func_dt.prg
uzs.prg
engel.rc
 


I'm getting something that :

hbmk2: Linking... engel.exe
C:/a/hrbg/lib/win/mingw/libdolphin.a(tdolpexp.o):tdolpexp.c:(.text+0x39): multiple definition of `HB_FUN_OLE2TXTERROR'
/a/fwh/lib/fivehg.lib(LEGACY.o):LEGACY.c:(.text+0x5bf): first defined here
C:/a/hrbg/lib/win/mingw/libdolphin.a(function.o):function.c:(.text+0x24): undefined reference to `mysql_close@4'
C:/a/hrbg/lib/win/mingw/libdolphin.a(function.o):function.c:(.text+0x5a): undefined reference to `mysql_free_result@4'
C:/a/hrbg/lib/win/mingw/libdolphin.a(function.o):function.c:(.text+0x1b5): undefined reference to `mysql_escape_string@12'
C:/a/hrbg/lib/win/mingw/libdolphin.a(function.o):function.c:(.text+0x2a0): undefined reference to `mysql_real_escape_string@16'
C:/a/hrbg/lib/win/mingw/libdolphin.a(function.o):function.c:(.text+0x3ae): undefined reference to `mysql_num_rows@4'
...
hbmk2: Error: Running linker. 1
gcc.exe .hbmk/win/mingw/engel.o .hbmk/win/mingw/xbrowse.o .hbmk/win/mingw/func.o .hbmk/win/mingw/func_brw.o .hbmk/win/mingw/func_dsg.o .hbmk/win/mingw/func_dt.o .hbmk/win/mingw/tarray.o .hbmk/win/mingw/uzs.o .hbmk/win/mingw/_hbmkaut_engel.o .hbmk/win/mingw/_hbmkaut_engel.reso .hbmk/win/mingw/engel.reso -mwindows -Wl,--start-group -lfivehg -lfivehgc -ldolphin -lgtgui -luser32 -lwinspool -lkernel32 -lcomctl32 -lcomdlg32 -lgdi32 -lole32 -loleaut32 -lpsapi -loledlg -lmfcuia32 -lmsimg32 -lwin32k -lstdc++ -lversion -luuid -lwinmm -lvfw32 -lwsock32 -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmzip -lodbc32 -lsddodbc -lrddsql -lhbpcre -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbmysql -lhbtip -lhbusrrdd -lhbvm -lhbwin -lhbzlib -lrddcdx -lrddfpt -lrddntx -lxhb -lpng -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 -oengel.exe -LC:/a/hrbg/lib/win/mingw -LC:/a/hrbg/bin -L/a/fwh/lib

Maybe you can share with win-make based project file ? Now Dolphin have project for one file , how to build with win-make foir a big numbers prgs ?

Thanks in advance ...
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: TDolphin - linking problems ...

Postby Daniel Garcia-Gil » Wed Mar 06, 2013 8:09 pm

Hello

you need add libmysql.lib

you can get it in dolphin/lib/mysql/coff/libmysqlm.lib (should work)
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: TDolphin - linking problems ...

Postby nnicanor » Wed Mar 06, 2013 10:40 pm

Rimantas, you can download libmysql.a

http://190.90.160.205/pruebas/libmysql_mingw.zip

Regards,
Nicanor Martinez M.
Auditoria y Sistemas Ltda.
MicroExpress Ltda.
FW + FWH + XHARBOUR + HARBOUR + PELLES C + XDEVSTUDIO + XEDIT + BCC + VC_X86 + VCC_X64 + MINGW + R&R Reports + FastReport + Tdolphin + ADO + MYSQL + MARIADB + ORACLE
nnicanor@yahoo.com
nnicanor
 
Posts: 295
Joined: Fri Apr 23, 2010 4:30 am
Location: Colombia

Re: TDolphin - linking problems ...

Postby Rimantas » Thu Mar 07, 2013 7:18 am

Daniel Garcia-Gil wrote:Hello
you need add libmysql.lib
you can get it in dolphin/lib/mysql/coff/libmysqlm.lib (should work)


Thanks Daniel ! MySql functions related errors dissapears . It leaves only that :

hbmk2: Linking... engel.exe
C:/a/hrbg/lib/win/mingw/libdolphin.a(tdolpexp.o):tdolpexp.c:(.text+0x39): multiple definition of `HB_FUN_OLE2TXTERROR'
/a/fwh/lib/fivehg.lib(LEGACY.o):LEGACY.c:(.text+0x5bf): first defined here
collect2: ld returned 1 exit status
hbmk2: Error: Running linker. 1
gcc.exe .hbmk/win/mingw/eng.o .hbmk/win/mingw/xbrowse.o .hbmk/win/mingw/func.o .hbmk/win/mingw/func_brw.o .hbmk/win/mingw/func_dsg.o .hbmk/win/mingw/func_dt.o .hbmk/win/mingw/tarray.o .hbmk/win/mingw/texcels.o .hbmk/win/mingw/uzs.o .hbmk/win/mingw/_hbmkaut_eng.o .hbmk/win/mingw/_hbmkaut_eng.reso .hbmk/win/mingw/engel.reso -mwindows -Wl,--start-group -lfivehg -lfivehgc -llibmysqlm -ldolphin -lgtgui -luser32 -lwinspool -lkernel32 -lcomctl32 -lcomdlg32 -lgdi32 -lole32 -loleaut32 -lpsapi -loledlg -lmfcuia32 -lmsimg32 -lwin32k -lstdc++ -lversion -luuid -lwinmm -lvfw32 -lwsock32 -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmzip -lodbc32 -lsddodbc -lrddsql -lhbpcre -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbmysql -lhbtip -lhbusrrdd -lhbvm -lhbwin -lhbzlib -lrddcdx -lrddfpt -lrddntx -lxhb -lpng -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 -oengel.exe -LC:/a/hrbg/lib/win/mingw -LC:/a/hrbg/bin -L/a/fwh/lib

With win-make in Dolphin folders it compiled fine ... :( . Maybe it worst to try to build with win-make ? Can share with win-make related project building sample for minGw ?
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: TDolphin - linking problems ...

Postby Daniel Garcia-Gil » Thu Mar 07, 2013 11:52 am

Hello

try add --allow-multiple-definition to linker command (ld)

please check:
https://groups.google.com/forum/?fromgroups=#!topic/harbour-users/_2CsENxyp7g
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: TDolphin - linking problems ...

Postby ADutheil » Thu Mar 07, 2013 12:39 pm

Daniel, why not just remove the function from tdolpexp.prg and use the one from Harbour?
And to use recent releases of Harbour you´ll have to replace all the Super calls with ::Super.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: TDolphin - linking problems ...

Postby Rimantas » Thu Mar 07, 2013 5:51 pm

Daniel Garcia-Gil wrote:Hello

try add --allow-multiple-definition to linker command (ld)

please check:
https://groups.google.com/forum/?fromgroups=#!topic/harbour-users/_2CsENxyp7g



Thanks Daniel ! Now building application is OK ... :) Other problems ...

Code: Select all  Expand view

   Error description: Error BASE/1003  Variable does not exist: DATATYPE_USER

Stack Calls
===========
   Called from: func_brw.prg => SETDOLPHIN( 283 )
   Called from: uzs.prg => UZSAK( 83 )
   Called from: engel.prg => RUN_PRG( 446 )
 


283 line ( copied from sources Setdolphin() function into own ) oBrw:nDataType := DATATYPE_USER

Mine source :
Code: Select all  Expand view

FUNCTION uzsak( cUzsak )
local oWnd, oBrw, oQry, oCol
local aDgr, aCol, aHdr, aWnd
local cFld, cSql, cStr
local cTbl := "uzsakym"
local cWnd := "uzsakym"
local nL_g := if( cLg == "L", 2, 3 )
local cYs  := msgId( "cTaip", cLg )
local cNo  := msgId( "cNe", cLg )
local lEdt := .t.
local u    := 0
local aMod := {}

local aGrd := { ;
{ "uzsak"         , "Užsak.ID"           , "Order.ID"         , 150 }, ;
{ "telkinys"      , "Telkinys"           , "Pool"             ,  80 }, ;
{ "pastabos_zs"   , "Pastabos Zarasu"    , "Notes of Zarasai" , 180 }, ;
...
{ "pok_lap_mod"   , "Pokav.lapo modelis" , "Pack.list model"  , 150 } }

default cUzsak := ""
cStr := if(  cLg == "L", "pav_lt", "pav_en" )
aMod := qry_arr( "SELECT preke FROM prekes WHERE prek_tipas = 'Gaminys' AND db = '" + cDb_id + "'", { "preke" } )

aWnd := wnd_rest( cWnd )
if len( aWnd ) == 0
   aWnd := { 20, 20, 500, 800, .f. }
endif

aDgr := brw_rest( cTbl, aGrd, cLg )
cFld := aDgr[ 1 ]
aCol := aDgr[ 2 ]
aHdr := aDgr[ 3 ]


cSql := "SELECT " + cFld + " FROM uzsakym WHERE db='" + cDb_id + "'"
oQry := oServ:Query( cSql )

DEFINE WINDOW oWnd MDICHILD OF wndMain() TITLE "Užsakymai" PIXEL FROM aWnd[ 1 ], aWnd[ 2 ] TO aWnd[ 3 ], aWnd[ 4 ]
if aWnd[ 5 ] == .f.
   oWnd:Move( aWnd[ 1 ], aWnd[ 2 ], aWnd[ 4 ], aWnd[ 3 ], .t. )
  else
   oWnd:Maximize()
endif
oWnd:Cargo := cWnd
   
@ 0, 0 XBROWSE oBrw OF oWnd COLUMNS aCol HEADERS aHdr // DATASOURCE oQry
SetDolphin( oBrw, oQry )

oBrw:nMarqueeStyle          := MARQSTYLE_HIGHLCELL
oBrw:nColDividerStyle       := LINESTYLE_BLACK
oBrw:nRowDividerStyle       := LINESTYLE_BLACK
oBrw:lColDividerComplete    := .t.

...

oBrw:Svarbus:bEditValue := { || oQry:FieldGet( "svarbus" ) == 1 }
oBrw:Svarbus:SetCheck( , .t., { cYs, cNo } )
oBrw:Spec:bEditValue := { || oQry:FieldGet( "spec" ) == 1 }
oBrw:Spec:SetCheck()
oBrw:Mazi:bEditValue := { || oQry:FieldGet( "mazi" ) == 1 }
oBrw:Mazi:SetCheck()

if len( aDgr ) > 0
   for u := 1 to len( oBrw:aCols )
      oBrw:aCols[ u ]:nWidth := aDgr[ 5, u ]
      oBrw:aCols[ u ]:lHide  := aDgr[ 6, u ]
   next
endif
oBrw:CreateFromCode()
oWnd:oClient := oBrw

ACTIVATE WINDOW oWnd ON INIT ( oBrw:GoBottom(), oBrw:SetFocus(), if( aWnd[ 5 ] == .t., oWnd:Maximize(), ) ) VALID ( brw_save( oBrw, cTbl ), wnd_save( oWnd, cWnd ), wnd_end( oBrw, oQry ), .t. )
return( NIL )

 


I tried SetDolphin( oBrw, oQry, .f. ) - the same . DATATYPE_USER don't exist in any include or other source . Strange , but your sample testfw2.prg with SetDolphin() function and with this DATATYPE_USER is running OK ... :) . What can you suggest in this situation ?

With best regards !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: TDolphin - linking problems ...

Postby Daniel Garcia-Gil » Thu Mar 07, 2013 5:55 pm

ADutheil wrote:Daniel, why not just remove the function from tdolpexp.prg and use the one from Harbour?
And to use recent releases of Harbour you´ll have to replace all the Super calls with ::Super.


Because not all use harbour and not all use last release from harbour
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: TDolphin - linking problems ...

Postby Daniel Garcia-Gil » Thu Mar 07, 2013 5:56 pm

Rimantas

With las fw version you dont need setdolohin... xbrowse handle it automatically
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: TDolphin - linking problems ...

Postby Rimantas » Thu Mar 07, 2013 6:01 pm

Daniel Garcia-Gil wrote:Rimantas

With las fw version you dont need setdolohin... xbrowse handle it automatically


Sorry Daniel , but at this moment I have Fwh 11.11 ...

Added :

I found that DATATYPE_USER in in xbrowse.ch . This include was not added to functions prg . Now this problem solved ... :)

It seems that query is working ! :D
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 27 guests