tags:

views:

889

answers:

3

Made a new project, added main.cpp and wrote the code at this URL:

http://www.boost.org/doc/libs/1_43_0/doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp

Also, added the appropriate include path.

What's next?!?!! It seems like a darn mystery to build a boost code!

Been digging on it for more than 10 hours.

Can anyone give a straightforward answer on how to build the boost library from the code under windows, VC9?

God bless you all.

+1  A: 

You need to use bjam. It is responsible for creating the libraries that your application will use. Once you use bjam, you are going to need to instruct your project to include the lib file. You do this by going into the project's properties -> Configuration Properties -> Linker -> General. Add the directory which created the lib file to Additional Library Directories. You should be capable of correctly linking after that. I believe that this link describes the steps better than I could attempt in a post

bogertron
+1  A: 

Not all Boost libraries are header only, Boost.System is one of them. The documentation for Boost.Asio tells you that it depends on Boost.System.

With Visual Studio, the Boost libraries use auto-linking, which means you don't have to explicitly link to the libraries you need. You however need to have the necessary libraries in the library search path, either globally or per-project.

If you don't want to build the Boost libraries yourself, you can use the installers provided by boostpro (only up to Boost 1.42 though at the moment). If you want to build them yourself instead, the documentation covers that well.

Georg Fritzsche
A: 

@bogertron: I want to hug you! (:

So, at last, with a real head ache, I've managed to do so.

The exact steps I took, so others will be saved from the head ache:

  1. Went to http://www.boost.org/doc/libs/1_43_0/more/getting_started/windows.html#or-build-binaries-from-source .

  2. Followed the "5.3.1 Get bjam" clause. Downloaded the "pre-built bjam executable for your platform" at this URL: http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941 .

  3. Extracted the ZIP file (my platform is Windows).

  4. Ran "build.bat". It produced the file "bin.ntx86/bjam.exe".

  5. Copied this file to my PATH ("...../boost_1_43_0/").

  6. From a command line, executed "bjam.exe" and waited for about 4-5 minutes.

Then got this message at the console: "The Boost C++ Libraries were successfully built!"

That's it, it even tells you where the include & lib files are.

What a relief!

THANK YOU! ++++!

Poni