HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: Compiling httrack
Author: steve
Date: 04/20/2007 04:02
 
I have finally managed to compile WinHTTrack and run it.There was no help guide
or doc on
how to compile the sources and getting it to run so to ease the pain and
sufferings of 
someone new having to compile this in Visual studio 6 all over again. I have
decided to list down the 
steps I have taken.If any steps is wrong please kindly let me know.Thanks 

Compiling WinHttrack on Visual Studio 6
1) If you install httrack from the httrack-3.41-2.exe downloaded from
<http://www.httrack.com/page/2/en/index.html> 
the sources codes will be at C:\Program Files\WinHTTrack\src_win & C:\Program
Files\WinHTTrack\src 
The WinHTTrack project will be at C:\Program
Files\WinHTTrack\src_win\WinHTTrack
2) Copy all the C:\Program Files\WinHTTrack\src files to the C:\Program
Files\WinHTTrack\src_win directory because the libhttrack project will look
for files in the src_win directory.
3) You need to download zlib at <http://www.zlib.net/> you will need the lib and
dll for compiling and running later on
Extract the zlib123-dll.zip(dll file) and zlib123.zip(source codes and lib) to
C:\Dev\zlib
4) Try to compile WinHttrack and you will get some errors in Visual Studio 6 
5) Since Microsoft Visual Studio 6 is not C99 compliant it will not recognise
the uintptr_t in htsinthash.h
you can download the two header files stdint.h & inttypes.h from
<http://code.google.com/p/msinttypes/downloads/list> and copy into C:\Program
Files\Microsoft Visual Studio\VC98\Include
add a include statement as shown below

In htsinthash.h
#ifdef _WIN32

#include <stddef.h>
#include <inttypes.h>/////////<-----added in 

#elif (defined(SOLARIS) || defined(sun) || defined(HAVE_INTTYPES_H) \


6) Remove the htsstaticno.h and htsstaticno.c from your project since they do
not exists in the libhttrack project
7) I dont need mms so remove it then can compile.

In htsglobal.h 
// utiliser mms://?
#ifndef HTS_USEMMS

//#define HTS_USEMMS 1

#endif


8) 
In HtmlCtrl.cpp,
void CHtmlCtrl::OnDestroy()
{
	// This is probably unecessary since ~CHtmlView does it, but
	// safer to mimic CHtmlView::OnDestroy.
	if (m_pBrowserApp) {
		m_pBrowserApp->Release();//<----m_pBrowserApp is a pointer so use -> instead
of .
		m_pBrowserApp = NULL; 
	}
	CWnd::OnDestroy(); // bypass CView doc/frame stuff
}

9)For the ATLTRACE macro you need to include <atlbase.h> 
and the Shutdown code SHTDN_REASON_MAJOR_APPLICATION and
SHTDN_REASON_MINOR_OTHER is defined in reason.h from VS2003 or above or from
the platform sdk
or copy and defined it from
<http://www.koders.com/c/fidB283F01142CC25330D4E521C66414DCF51F648F3.aspx>
FUNCTION macro is not available in VS 6 only VS2003 and later so you can
download the xtrace files 
from <http://www.codeproject.com/useritems/xtrace.asp> include the xtrace.cpp in
your winhttrack project and put the xtrace.h in your C:\Program
Files\Microsoft Visual Studio\VC98\Include
my xtrace.h and xtrace.cpp is in C:\Dev\xtrace so added this directory to the
project additional include directories under the c/C++ tab

at the end of stdafx.h add the following include statement

#include <atlbase.h>
#include <reason.h>
#include <xtrace.h>

10)Also add the winmm.lib next to wsock32.lib to the project in project
settings in link tab underObject/Libraries modules or you will get unresolved
external for the play sound function call

11)Finally you should be able to compile and generate the winhttrack.exe in
the temp directory

12)to be able to run and not get the lang.def missing error messgae when
running copy the 
C:\Program Files\WinHTTrack\lang to your directory of your
winhttrack.exe(default is c:\temp) and also copy the lang.def file in the same
directory.
Ensure that the zlib1.dll is assessable it can be located at  C:\Dev\zlib so
include C:\Dev\zlib in your path env variable so can assess it.

The End......
 
Reply Create subthread


All articles

Subject Author Date





8

Created with FORUM 2.0.11