Page 3 of 3

Re: Wrapper for LIBXL libxlsxwriter.dll for Harbour

Posted: Thu Apr 16, 2020 5:44 pm
by RPC
Hi bpd2000
Thanks
Changed as you suggested. It compiles now and I get libxlw.exe but what does it do ?
Should I compile demo.prg in example subdir ,but then what files need to be added to modules tab in IDE besides demo.prg,
There are many *.prg files in examples subdir.
Pls advice.
Thanks

Re: Wrapper for LIBXL libxlsxwriter.dll for Harbour

Posted: Fri Apr 17, 2020 2:21 am
by bpd2000
RPC wrote: Thu Apr 16, 2020 5:44 pm Hi bpd2000
Thanks
Changed as you suggested. It compiles now and I get libxlw.exe but what does it do ?
Should I compile demo.prg in example subdir ,but then what files need to be added to modules tab in IDE besides demo.prg,
There are many *.prg files in examples subdir.
Pls advice.
Thanks
Hi
1. This wrapper and examples are for Harbour [no gui]
2. Download Attached working folder [posted as on 11/04/2020 page-1]
3. Unzip to C drive [i.e C:\hblibxlsxwriter]
4. set required path for harbour and mingw compiler
5. open cmd window at C:\hblibxlsxwriter and run make_lib.cmd [it will create libhblibxlsxwriter.a library]
5. open cmd window at C:\hblibxlsxwriter\example and run test.cmd [it will create demo.exe]
6. now run demo.exe from cmd window [it will create demo.xlsx silently in the same folder]
If you success, then study the code, .hbp files etc. and start incorporating in HMG

Re: Wrapper for LIBXL libxlsxwriter.dll for Harbour

Posted: Fri Apr 17, 2020 7:56 am
by RPC
bpd2000 wrote: Fri Apr 17, 2020 2:21 am 4. set required path for harbour and mingw compiler
5. open cmd window at C:\hblibxlsxwriter and run make_lib.cmd [it will create libhblibxlsxwriter.a library]

Hi bpd2000
Thanks for step by step guide.
I have come upto step 5 and get following error

C:\hblibxlsxwriter>hbmk2 libxlw.hbp
Harbour 3.2.0dev (r1703241902)
Copyright (c) 1999-2016, http://harbour-project.org/
Compiling 'hblibxlsxwriter.prg'...
Lines 5520, Functions/Procedures 171
Generating C source output to 'C:\Users\rpcch\AppData\Local\Temp\hbmk_conllm.dir\hblibxlsxwriter.c'... Done.
C:/Users/rpcch/AppData/Local/Temp/hbmk_conllm.dir/hblibxlsxwriter.o:hblibxlsxwriter.c:(.data+0xa8): undefined reference to `HB_FUN_HB_CSTRUCTURE'
C:/Users/rpcch/AppData/Local/Temp/hbmk_conllm.dir/hblibxlsxwriter.o:hblibxlsxwriter.c:(.data+0xd48): undefined reference to `HB_FUN_HB_CSTRUCTURECSYNTAX'
C:/Users/rpcch/AppData/Local/Temp/hbmk_conllm.dir/hblibxlsxwriter.o:hblibxlsxwriter.c:(.data+0xd68): undefined reference to `HB_FUN___ACTIVESTRUCTURE'
collect2.exe: error: ld returned 1 exit status
hbmk2[libxlw]: Error: Running linker. 1
gcc.exe C:/Users/rpcch/AppData/Local/Temp/hbmk_conllm.dir/hblibxlsxwriter.o C:/Users/rpcch/AppData/Local/Temp/hbmk_conllm.dir/hbmk_nod7j8.o -mconsole -Wl,--start-group -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 -lhbmainstd -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -liphlpapi -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib -Wl,--end-group -ohblibxlsxwriter.exe -Lc:/hmg.3.4.4/harbour/lib/win/mingw

hbmk2: Hint: Add option 'xhb.hbc' for missing function(s): __ActiveStructure(),
hb_CStructureCSyntax(), hb_CStructure()


It is asking to 'Add option xhp.hbc' how to do that ?
Please help
Thanks

Re: Wrapper for LIBXL libxlsxwriter.dll for Harbour

Posted: Fri Apr 17, 2020 8:03 am
by bpd2000
use command as
hbmk2 libxlw.hbp xhb.hbc
or add xhb.hbc in make_lib.cmd

Re: Wrapper for LIBXL libxlsxwriter.dll for Harbour

Posted: Fri Apr 17, 2020 9:26 am
by RPC
bpd2000 wrote: Fri Apr 17, 2020 8:03 am use command as
hbmk2 libxlw.hbp xhb.hbc
or add xhb.hbc in make_lib.cmd
Hi bpd2000
Got it now, though had to add path for xhb.hbc
Many thanks
Now how to link this so that lxw_* functions are available on HMG programs ?

Re: Wrapper for LIBXL libxlsxwriter.dll for Harbour

Posted: Fri Apr 17, 2020 3:03 pm
by bpd2000
RPC wrote: Fri Apr 17, 2020 9:26 am
bpd2000 wrote: Fri Apr 17, 2020 8:03 am use command as
hbmk2 libxlw.hbp xhb.hbc
or add xhb.hbc in make_lib.cmd
Hi bpd2000
Got it now, though had to add path for xhb.hbc
Many thanks
Now how to link this so that lxw_* functions are available on HMG programs ?
Follow this for HMG32
1. Copy hblibxlsxwriter.ch to c:\hmg\include
2. Copy libhblibxlsxwriter.a to c:\hmg\lib
3. add libs=hblibxlsxwriter at line no 52 of hmg32.hbc
4. now build example [c:\hmg\build demo.prg]

Re: Wrapper for LIBXL libxlsxwriter.dll for Harbour

Posted: Sat Apr 18, 2020 9:46 am
by RPC
bpd2000 wrote: Fri Apr 17, 2020 3:03 pm Follow this for HMG32
Hi bpd2000
Finally got it.
Many thanks for patiently explaining everything.
with best wishes.

Re: Wrapper for LIBXL libxlsxwriter.dll for Harbour

Posted: Fri Jul 10, 2020 11:57 pm
by AUGE_OHR
hi,

i try to get libxlsxwriter.DLL 64 Bit, from Daniel (https://www.hmgforum.com/viewtopic.php? ... 5&start=62 ), running with Wrapper hblibxlsxwriter
https://github.com/FTrautwein/hblibxlsxwriter

i have done that way successful for 32 bit
i was able to create 64 Bit LIB of Wrapper but nothing happens ... no *.XLSx create :o
so i look into hblibxlsxwriter.PRG

Code: Select all

FUNCTION lxw_init() 
   nHDll:= hb_libLoad( "libxlsxwriter.dll" )
*RETURN NIL
RETURN nHDll
i have modify Code to "RETURN nHDll" but under 64 Bit i got "U" ... hm

i also try "old Style"

Code: Select all

   nHDll := HMG_CallDLL( "Kernel32.dll",, "LoadLibrary", "libxlsxwriter.dll" )
but i got 0 under 64 Bit :evil:

hb_libLoad() / HMG_CallDLL(... "LoadLibrary") work with other DLL (32 Bit) so i´m not sure what the Problem is.

---

attach Source i use to build under 32 / 64 Bit
HB64_XLSX.ZIP
(157.1 KiB) Downloaded 237 times
change into \xlsxwriter and copy all *.h include xlsxwriter\third_party to c:\hmg.3.4.4\HARBOUR-64\include\
now try run Make_Lib.cmd

if Environment does not have Path to Compilier / Linker start

Code: Select all

   c:\hmg.3.4.4\build64.bat
and than again Make_Lib.cmd

now, i hope, you got libhblibxlsxwriter.a
copy it to c:\hmg.3.4.4\LIB-64\

now try to create *.XLSx
use Source from \DEMO
no *.XLSx are create under 64 Bit ... :(

Re: Wrapper for LIBXL libxlsxwriter.dll for Harbour

Posted: Wed Jul 15, 2020 4:33 am
by AUGE_OHR
hi,

did some get Wrapper hblibxlsxwriter under 64 Bit running :?: