You are not logged in.
Compiling libHTTP
Note! Currently this guide is aimed at building libHTTP with Visual Studio .NET 2003 but the library is portable and in future this guide should cater for other platforms. If you have one you need help with now post here.
libHTTP is developed under the Boost.Build System v2 (BBv2 from here on). I use this system as it is tightly integrated with Boost and it is portable. Unfortunately the build system does not seem to be in use too much and so may be unknown to many potential users of libHTTP. It is my hope that this document, or future revisions of it, will guide users through the process of building libHTTP.
Step 1, downloading Boost.
libHTTP relies on two Boost libraries not shipped with Boost 1.33.1, namely Boost.ASIO and Boost.Statechart. ASIO is due for inclusion in Boost 1.35 while Statechart will be shipped with 1.34.
For the time being libHTTP releases include the non Boost variant of ASIO and try to keep up with CVS snapshots as appropiate. Users tracking libHTTP SVN will need to download ASIO CVS separately from SourceForge.net.
Since Boost 1.34 appears to be around the corner I am writing this guide towards it and instead of recommending you download 1.33.1 and add Statechart I encourage users to get the release candidate of 1.34 as pre these instructions credited to Dean Michael Berris
cvs -d:pserver:anonymous@boost.cvs.sourceforge.net/cvsroot/boost login cvs -z3 -d:pserver:anonymous@boost.cvs.sourceforge.net/cvsroot/boost export -r RC_1_34_0 boost cvs -d:pserver:anonymous@boost.cvs.sourceforge.net/cvsroot/boost logout
Step 2, setting up BBv2.
BBv2 is a very powerful build system well beyond the scope of this article so I am going to concentrate on getting a minimal system up and running capable of compiling libHTTP.
Start with a root folder and into that place the downloaded Boost and libHTTP (called just Http by default) folders. Now inside the root folder create a file called Jamroot with the following text.
import modules ; import os ; import errors ; import feature : feature ; BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ; path-constant /boost : $(BOOST_ROOT) ; path-constant /http : Http/Http ;
Now you need to edit two files. Open up user-config.jam found in the Boost\tools\build\v2\ folder and locate the line
# using msvc ;
and change it to
using msvc : 7.1 ;
if using Visual Studio .NET 2003.
Secondly open up the Jamfile in the LibHTTP Examples directory (This is subject the chage in the future) and comment (with the hash '#' symbol) out the lines
use-project /osLibs : $(/osLibs) ; ... <library>/osLibs//mingwwsock2 <library>/osLibs//mingwws2_32
Finally download the bjam exe from SourceForge and place it somewhere accessible on the PATH.
Step 3, building the library.
Almost there
. Fire up a console window and create two environment variables with the following commands.
set BOOST_ROOT=**location of Boost** set BOOST_BUILD_PATH=%BOOST_ROOT%\tools\build\v2
Now navigate to the libHTTP folder and execute the following command to build debug versions of the library linked against the multi-threading C++ libraries.
bjam --v2 msvc-7.1 debug threading=multi
If that is successful you should find four compiled programs at the end of the 'Http\Examples\bin\...\' folder hierarchy. Try running both a server and its corresponding client to make sure everything is working. The library can be found in 'Http\Http\bin\...\' folder.
Appendix
A. The BBv2 docs are a highly recommended read if you wish to better understand the build system.
B. The messy commenting out of references to 'osLibs' is because I haven't found a neat way to implement linking against OS libraries where necessary. This problem only gets worse when OpenSSL support used. I will have to dig around the ASIO Jamfiles to see how Christopher Kohlhoff gets around this.
Offline
Hello ,Eóin ,I am from CHINA.
I compile the libhttp according to here,but still failed.
All the step I had completely , and the console show the failed msg:
>bjam --v2 msvc-7.1 debug threading=multi
warning: no toolsets are configured.
warning: you won't be able to build C++ programs.
warning: please consult the documentation.
notice: could not find main target msvc-7.1
notice: assuming it's a name of file to create
don't know how to make msvc-7.1
...found 1 target...
...can't find 1 target...
I dont know what's wrong with there .
Offline
Hi demon.
Those warnings mean that the user-config file does not have the msvc toolkit properly setup. It should only be a matter of replacing the "# using msvc ;" line (approx 32) with "using msvc : 7.1 ;" as shown above.
Note that the spaces in those lines, for example before the final semi-colon, are very important. I you can't get it to work you could email me your user-config.jam file.
Offline
I compile it completely and correct .
Thank you .
Offline
Hi,
I got the following errors:
-------------------------
C:\docs\codelibs\Http\Http\Jamfile:6: in modules.load
*** argument error
* rule use-project ( id : where )
* called with: ( /openssl : )
* missing argument where
c:/docs/codelibs/boost/tools/build/v2/build\project.jam:951:see definition of ru
le 'use-project' being called
c:/docs/codelibs/boost/tools/build/v2/build\project.jam:312: in load-jamfile
c:/docs/codelibs/boost/tools/build/v2/build\project.jam:68: in project.load
c:/docs/codelibs/boost/tools/build/v2/build\project.jam:718: in project.use
c:/docs/codelibs/boost/tools/build/v2/build\project.jam:94: in load-used-project
s
c:/docs/codelibs/boost/tools/build/v2/build\project.jam:79: in load
c:/docs/codelibs/boost/tools/build/v2/build\project.jam:170: in project.find
c:/docs/codelibs/boost/tools/build/v2/build\targets.jam:394: in find-really
c:/docs/codelibs/boost/tools/build/v2/build\targets.jam:410: in find
c:/docs/codelibs/boost/tools/build/v2/build\targets.jam:287: in targets-to-build
c:/docs/codelibs/boost/tools/build/v2/build\targets.jam:253: in object(project-t
arget)@16.generate
c:/docs/codelibs/boost/tools/build/v2\build-system.jam:401: in load
c:\docs\codelibs\boost\tools\build\v2/kernel\modules.jam:261: in import
c:\docs\codelibs\boost\tools\build\v2/kernel/bootstrap.jam:132: in boost-build
c:\docs\codelibs\boost\tools\build\v2\boost-build.jam:8: in module scope
C:\docs\codelibs\Http>
Offline
Could you please extend your guide to Linux? I have both Boost and Boost.Asio installed on my system but I'm unable to build libHTTP.
Offline
Hello, Eóin.
What I should do to compile libHttp with OpenSSL support? When I specified the path to the OpenSSL installation bjam spoked that it didn't see Jamfile in the path.
Offline
Vibram five fingers shoes on sale is one kind of revolutionary innovations .The soles produced by Vibram are called Vibram soles, Vibram rubber, or simply Vibram.,Modern age, what the Vibram shoes are accepted is more and more. Vibram Fivefingers KSO has become the model man who we most receive welcome., Simple and fashion design. Vibram Fivefingers KSO does not decolorize the shoe sole rubber Vibram first trial chamber's performance to protect your foot, stimulates better balanced, helps to aline the vertebra and the improvement overall body posture. Mens Vibram Five Fingers Sprint , Maintains both feet comfortable cool. The shoes' durability and perfect travel. Thin, the wear resistant tension polyamide fiber fabric suits low - - comfortable and the rapid drying. Enhances the flexibility and the scope, in ankle area and foot bill. Strengthens the individual toe clever slot,Cheap five fingers sale www.2010newshoes.com,the control and provides a natural walk movement stably.Vibram Five Fingers Classic Improvement and body's balanced and consciousness. The shoe pad function Aegis microorganism shield antibacterial treatment controls the smell. Therefore, from this moment, you can do any moves you to have such pair of five fingers shoes, perhaps is walks, the hike or fishin. Vibram five-fingers shoes is an amazing feeling, footwear revolution.Order now.Womens Vibram Five Fingers
Offline