Harbour and ZIP files

Harbour and ZIP files

Postby TimStone » Tue Feb 09, 2016 12:20 am

I'm trying to build a routine that does a simple zip of files, and unzipping of files.

With xHarbour, hb_zipfile() and hb_unzipfile() have a set of libs and it works perfectly.

However, I want to build this with Harbour. I am linking in hbziparc.lib, hbzlib.lib, hbmzip.lib and minizip.lib. Unfortunately the linker still shows 9 functions missing, so apparently I am missing a .lib file. These functions are included in mzip.c which should be in one of the .libs ( like minizip.lib ).

Is anyone using Harbour with zip functions ? If so, from my list above, can you tell what .lib file I am missing ?

Here are the missing functions:

--------------------Configuration: MLS10us - Release--------------------
harbour C:\Projects\MLS10aus\Source\M10us.prg /n /gc0 /q0 /iC:\Harbour\INCLUDE /iC:\fwh\INCLUDE /w1 /l /oM10us.c
C:\Projects\MLS10aus\Source\M10us.prg(17) Error F0029 Can't open #include file 'hbmzip.ch'
LINK /nologo /subsystem:windows /force:multiple /NODEFAULTLIB:libc /NODEFAULTLIB:msvcrt M10us.obj TDATA.obj Kukui.obj aswEmail.obj DemandForce.obj mls10.res FiveHC32.lib FiveH32.lib hbrtl.lib hbvm.lib gtgui.lib gtwin.lib hblang.lib hbmacro.lib hbrdd.lib rddntx.lib rddcdx.lib rddfpt.lib hbsix.lib xhb.lib hbcplr.lib hbziparc.lib hbziparc_dll.lib minizip.lib hbzlib.lib hbmzip.lib hbdebug.lib hbcommon.lib hbpp.lib hbwin.lib hbcpage.lib hbct.lib hbpcre.lib png.lib C:\Harbour\UserLibs\ace32.lib C:\Harbour\UserLibs\rddads.lib kernel32.lib user32.lib gdi32.lib winspool.lib comctl32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib oledlg.lib winmm.lib uuid.lib odbc32.lib odbccp32.lib iphlpapi.lib mpr.lib version.lib wsock32.lib psapi.lib msimg32.lib libcmt.lib oldnames.lib libcpmt.lib gdiplus.lib libeay32.lib ssleay32.lib hbtipssl.lib hbssl.lib ws2_32.lib wcapm.lib
Creating library M10us.lib and object M10us.exp
M10us.obj : error LNK2001: unresolved external symbol _HB_FUN_ZIPNEW
M10us.obj : error LNK2001: unresolved external symbol _HB_FUN_ZIPOPEN
M10us.obj : error LNK2001: unresolved external symbol _HB_FUN_ZIPGETLASTERROR
M10us.obj : error LNK2001: unresolved external symbol _HB_FUN_ZIPSETFILEPATH
M10us.obj : error LNK2001: unresolved external symbol _HB_FUN_ZIPSETEXTRACTPATH
M10us.obj : error LNK2001: unresolved external symbol _HB_FUN_ZIPSETPASSWORD
M10us.obj : error LNK2001: unresolved external symbol _HB_FUN_ZIPEXTRACTFILES
M10us.obj : error LNK2001: unresolved external symbol _HB_FUN_ZIPCLOSE
M10us.exe : fatal error LNK1120: 8 unresolved externals
MLS10us.EXE - 10 error(s), 0 warning(s)

Thank you for your assistance
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Harbour and ZIP files

Postby Antonio Linares » Tue Feb 09, 2016 12:30 am

Tim,

hbziparc.lib is a Harbour library. I just checked it and it is there.

Maybe the names have changed.

http://www.fivetechsoft.com/harbour-doc ... hb_ZipFile

right. You have to use HB_ in front of each function name
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41460
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour and ZIP files

Postby TimStone » Tue Feb 09, 2016 12:34 am

I am using the functions correctly, and I do link in that file. However, it depends on functions found in mzip.c which must be in a different .lib file.

The following .libs must be linked and take care of most of the functions:

hbziparc.lib hbmzip.lib, hbzlib.lib, minizip.lib

Looking at the source I found the missing functions in mzip.c but I don't know which .lib contains it.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Harbour and ZIP files

Postby Antonio Linares » Tue Feb 09, 2016 7:50 am

Tim,

Harbour hbmzip.lib contains mzip.c
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41460
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour and ZIP files

Postby byte-one » Tue Feb 09, 2016 10:10 am

Tim, i use
hbziparc.lib
hbzlib.lib
hbmzip.lib
minizip.lib

Please try in your test to make a zip WITH included paths! I cannot open this ZIP-file produced with path. Without path is ok.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Harbour and ZIP files

Postby TimStone » Tue Feb 09, 2016 5:18 pm

Gunther,

Thank you. I had been using those all along, but not in that order. After all the research I did, it now makes sense why that order is important.

Also, some of the commands early on were functions not supported by Harbour, but that is not a problem since the main tasks are simple.

I now have a build.

I will test and see if it works with a path.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Harbour and ZIP files

Postby byte-one » Fri Feb 12, 2016 8:02 pm

Tim, have you already tested with path?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Harbour and ZIP files

Postby TimStone » Sat Feb 13, 2016 4:35 pm

Can you send me a sample of your path statement? I include a path to the files and in some cases a path to where i want them unpacked but it is in the command code, not the zip. That works.


Sent from my iPhone using Tapatalk
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Harbour and ZIP files

Postby byte-one » Sun Feb 14, 2016 1:33 pm

Tim,
Code: Select all  Expand view
HB_ZIPFILE( cFile , aDatei, nLevel ,{|cFile,nPos|(caktfile:=cfile,oDlg_k:update(),sysrefresh())} , lOver ,rtrim(cPW), lpath)

When i use lpath = .T. the zip-file are not readable. The size from the zip-file seems normal.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 120 guests